www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Linking on windows

reply Henning Hasemann <hhasemann web.de> writes:
I'm currently working on a project that uses SDL with a static binding.
Up to know I developed under linux but since it should be
multi-platform I thought it would be a good idea to test it on windows.

The problem is that optlink (link.exe) says the SDL-lib would not be a
valid library (the VC one the mingw one ".a" does not work at all as
expected).

I tried numerous other linkers (lcclnk, the one from VC express, ...)
They in turn dont seem to understand the obj-format produced by dmd, so
I assume that is a special format thats not compatible with VC stuff?

Why does optlink not eat SDL? Do I have to compile it by hand with a
digitalmars C compiler? (Would be a pain for me under windows)

Thanks for any help,

Henning

-- 
GPG Public Key:
http://keyserver.ganneff.de:11371/pks/lookup?op=get&search=0xDDD6D36D41911851
Fingerprint: 344F 4072 F038 BB9E B35D  E6AB DDD6 D36D 4191 1851
Jun 28 2007
parent reply Johan Granberg <lijat.meREM OVEgmail.com> writes:
Henning Hasemann wrote:

 
 I'm currently working on a project that uses SDL with a static binding.
 Up to know I developed under linux but since it should be
 multi-platform I thought it would be a good idea to test it on windows.
 
 The problem is that optlink (link.exe) says the SDL-lib would not be a
 valid library (the VC one the mingw one ".a" does not work at all as
 expected).
 
 I tried numerous other linkers (lcclnk, the one from VC express, ...)
 They in turn dont seem to understand the obj-format produced by dmd, so
 I assume that is a special format thats not compatible with VC stuff?
 
 Why does optlink not eat SDL? Do I have to compile it by hand with a
 digitalmars C compiler? (Would be a pain for me under windows)
 
 Thanks for any help,
 
 Henning
 
Visual studio and dmc uses different object fromats so to link libs and object files together they have to be produced by the same tool or converted to the right format (I think there was a tool that did that floating around somewhere).
Jun 28 2007
parent reply Henning Hasemann <hhasemann web.de> writes:
 Visual studio and dmc uses different object fromats so to link libs
 and object files together they have to be produced by the same tool or
 converted to the right format (I think there was a tool that did that
 floating around somewhere).
Thanks! I think I found it: http://www.digitalmars.com/ctg/coff2omf.html -- GPG Public Key: http://keyserver.ganneff.de:11371/pks/lookup?op=get&search=0xDDD6D36D41911851 Fingerprint: 344F 4072 F038 BB9E B35D E6AB DDD6 D36D 4191 1851
Jun 28 2007
next sibling parent Jascha Wetzel <firstname mainia.de> writes:
note that you may need to use MS link.exe from the VC6 package 
(Microsoft (R) Incremental Linker Version 6.00.8168) to convert COFF 
libs to a pre-VC6 format for coff2omf to be able to handle it.
the MS link shipped with VC7 and later doesn't support the conversion 
anymore.

Henning Hasemann wrote:
 Visual studio and dmc uses different object fromats so to link libs
 and object files together they have to be produced by the same tool or
 converted to the right format (I think there was a tool that did that
 floating around somewhere).
Thanks! I think I found it: http://www.digitalmars.com/ctg/coff2omf.html
Jun 28 2007
prev sibling parent reply Downs <default_357-line yahoo.de> writes:
Generally, when needing to build apps that need C libraries under win32, I have
found it far easier to just grab the DLLs and run implib over them (which is
free, as opposed to coff2omf). Just don't forget the /system ^^
Jun 28 2007
parent Henning Hasemann <hhasemann web.de> writes:
Downs <default_357-line yahoo.de> schrieb (Thu, 28 Jun 2007 07:57:00
-0400):
 Generally, when needing to build apps that need C libraries under
 win32, I have found it far easier to just grab the DLLs and run
 implib over them (which is free, as opposed to coff2omf). Just don't
 forget the /system ^^
Thanks, worked very fine and also easy! Henning -- GPG Public Key: http://keyserver.ganneff.de:11371/pks/lookup?op=get&search=0xDDD6D36D41911851 Fingerprint: 344F 4072 F038 BB9E B35D E6AB DDD6 D36D 4191 1851
Jun 28 2007