www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DMD & Deimos || GDC & Deimos?

reply "Entry" <d d.com> writes:
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 :/
Apr 26 2014
next sibling parent Mike Wey <mike-wey example.com> writes:
On 04/26/2014 08:18 PM, 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 :/
With MinGW you would use the: -static-libgcc flag when linking the application. I'm not sure if gdc also supports this, but you can give it a try. -- Mike Wey
Apr 26 2014
prev sibling next sibling parent Mike Parker <aldacron gmail.com> writes:
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.
Apr 26 2014
prev sibling parent David <d dav1d.de> writes:
Am 26.04.2014 20:18, schrieb Entry:
 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 :/
I have a 10 month old glfw3.dll https://github.com/Dav1dde/BraLa/tree/master/lib/win Since glfw didnt change much (that was already at release), this is probably enough for you. Simply pass the glfw3.lib to the compiler and make sure glfw3.dll is reachable in runtime. But you can also build your own using cygwin (that's how I made it) and use implib for format conversion.
Apr 27 2014