betterC DLL in Windows

Tamas km212121 at
Sat Feb 4 18:40:51 UTC 2023

On Saturday, 4 February 2023 at 18:27:34 UTC, Adam D Ruppe wrote:
> On Saturday, 4 February 2023 at 18:11:05 UTC, Tamas wrote:
>> Well, as I'm new to D this isn't something I have insight into.
> Then you'd probably be better off taking my word for it (or 
> even trusting your own limited experience where things worked 
> until you added the switch) and just not using -betterC switch.
> It is hopelessly broken, but thankfully, it also brings zero 
> benefit, so simply not using it is a viable path forward.

I do take your word for it, but now I have to re-evaluate my 
expectations towards D and perhaps use it for another project. 
I've got most of my project working in C already, but I was 
hoping to add some safety and better readability/managability by 
using some of the convenient features D offers over C. And, of 
course, learn D in the process. Also, your words give me the 
impression that I cannot trust the documentation; which isn't a 
great start into the learning process.

>> I mostly need interop with C libraries and D would only serve 
>> as a glue, so I don't really need several features like GC etc.
> Just don't call those functions and they won't hurt you, aside 
> from adding ~200 KB of size to the dll. On the other hand, the 
> -betterC switch is hurting you - as evidenced by your own 
> attempt working until you added it.

It can be evidence of something broken in D as you say 
(simplified) or of my lack of experience with D - a simple 
missing include, badly configured PATH, or lack of understanding 
on my part what SimpleDllMain does.

More information about the Digitalmars-d-learn mailing list