How can I request smthg related to the Win run-time ?

Kapps opantm2+spam at gmail.com
Tue Mar 5 01:30:55 PST 2013


On Tuesday, 5 March 2013 at 08:08:27 UTC, Mike Parker wrote:
> On Monday, 4 March 2013 at 18:27:47 UTC, cal wrote:
>> On Monday, 4 March 2013 at 16:28:36 UTC, D-ratiseur wrote:
>>> Ok, thx, I've created the prototype and also tried to 
>>> dynamically
>>> link the method. It's true that SetEndOfFile is not used at 
>>> all
>>> in Phobos, that's explain well why the proto is not declared.
>>
>> Note you shouldn't need to dynamically link, dmd will link 
>> against Kernel32.lib anyway. Declaring the proto is enough.
>
> In this particular instance that is true, but I've found that 
> it's not always the case. The Win32 link libraries that ship 
> with DMD seem to be rather old (unless they've been updated in 
> the last year or so). I haven't dug into it too deeply, but I'm 
> guessing they're based on the XP era of the API and anything 
> added since Vista isn't going to be exposed. That will cause 
> link errors. I encountered this with some of the post-XP 
> functions in shell32.lib and had to resort to loading them 
> dynamically.

You can also just use coffimplib and link to them statically, 
that's the approach I used.

Though I suppose this might be confusing when someone else tries 
compiling your code...


More information about the Digitalmars-d mailing list