DMD & Deimos || GDC & Deimos?

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 26 18:45:06 PDT 2014


On 4/27/2014 3:18 AM, Entry wrote:
> I'd like to use GLFW from Deimos, but I couldn't get it to work (DMD
> said it cannot use libglfw.a) and I've read somewhere that only GDC can
> use these DLLs directly (with a D header, but that's still better than
> hooking the methods). So do I need GDC for that or not? And would you
> actually recommend it?
>
> On a side note, getting GDC to work is a bitch. I had to copy around
> several DLLs (like libiconv-2.dll) and it's now working only with the
> libgcc_s_sjlj-1.dll copied right next to my application's exe. What am I
> doing wrong?
>
> This is really frustrating :/

32-bit DMD on Windows expects object files in the OMF format. MinGW, 
IIRC, outputs objects in the COFF format. 64-bit DMD uses the COFF 
format through the Microsoft toolchain, but I don't know if that 
toolchain can link with MinGW libraries (it works the other way).

I suggest one of three things:

* Use the glfw DLL rather than the static library. You can use it with 
32-bit DMD by running implib on the DLL and then linking with the 
resulting import library (which will be in OMF format).

* Compile GLFW in 64-bit with Visual C++ then compile your project with 
DMD in 64-bit using the MS toolchain. You should be able to link 
statically or dynamically without trouble here.

* Use DerelictGLFW and don't worry about linking with anything. It loads 
glfw.dll at runtime so that there are no compile-time dependencies other 
than Derelict itself.


More information about the Digitalmars-d-learn mailing list