Win32 + OpenGL bindings

Diggory diggsey at googlemail.com
Sun Apr 21 08:20:24 PDT 2013


OK, thanks I think I've got the hang of the way linking works now 
- I was confused about how some things didn't seem to require 
libs to work, but now I see it's because those things were 
compiled into "druntime.lib" which was compiled into "phobos.lib".

So is this correct, assuming I'm only talking about non-COFF libs:
- D code can link directly to normal C libs
- .libs generated by DMD are a superset of normal C .libs, they 
can contain normal C functions but DMD also has some way of 
representing more complicated D constructs inside the .lib file 
(but not templates).
- druntime.lib is linked into phobos.lib so only phobos.lib needs 
to be linked and the compiler does this automatically (how does 
this work, is just hard-coded in?)

Is there a compiler independent way to tell the linker to 
automatically link in a specific library from within a .d file? 
(preferable this hint should still exist in the .di file 
generated from that .d file, and be transitive so dependencies 
automatically get linked in just by "import"ing the required 
stuff) If not can I suggest this as a feature?

I've switched to using the "head" revision in the repo and 
building from source which was surprisingly easy (thanks whoever 
set that up!) so now I can just add missing functions to 
windows.d as I need and rebuild and no more linker errors!

Am I correct in thinking there is no specific order in the 
contents of windows.d? I've rearranged mine so that functions are 
ordered by module then header file so I can more easily see if a 
function already exists, and if not where to add it. Would these 
changes be of any use?


More information about the Digitalmars-d-learn mailing list