www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Windows MinGW and DMD

reply David <d dav1d.de> writes:
So I want to make the compilation of my little game work on Windows, I 
set up MinGW with Msys and ran the makefile, after a few fixes 
compilation worked, the problem is linking fails hard.

I need a few external libraries in C like glfw3 and openssl, latter I 
installed with `mingw-get install msys-libopenssl` and I compiled glfw3 
with the makfile and gcc.

Now how can I link this all together? I have .a static libs (which are 
.lib libs, after renaming?) and .o files from gcc (I have a few C files) 
and .obj files from dmd.
I hope you can help me out, because I have no idea how that kind of 
stuff works on Windows and I heared it's a real mess with OMF and COFF.

Thanks.
Sep 28 2012
parent "Mike Parker" <aldacron gmail.com> writes:
On Friday, 28 September 2012 at 18:10:36 UTC, David wrote:
 So I want to make the compilation of my little game work on 
 Windows, I set up MinGW with Msys and ran the makefile, after a 
 few fixes compilation worked, the problem is linking fails hard.

 I need a few external libraries in C like glfw3 and openssl, 
 latter I installed with `mingw-get install msys-libopenssl` and 
 I compiled glfw3 with the makfile and gcc.

 Now how can I link this all together? I have .a static libs 
 (which are .lib libs, after renaming?) and .o files from gcc (I 
 have a few C files) and .obj files from dmd.
 I hope you can help me out, because I have no idea how that 
 kind of stuff works on Windows and I heared it's a real mess 
 with OMF and COFF.

 Thanks.
IIRC, MinGW uses the COFF format, which is the same format used by the Microsoft tools. The DMD toolchain currently is OMF only. You might be able to use coff2omf without any extra steps[1], but I'm not sure what version of COFF MinGW uses. I would really recommend using DerelictGLFW3 in this case and just build glfw3 as a shared lib. But I don't know of any similar binding for OpenSSL. [1] http://www.digitalmars.com/ctg/coff2omf.html
Sep 30 2012