www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Howto use an alternative Linker with DUB?

reply "univacc" <univacc mail.de> writes:
Hi,

I am sitting in front of this problems for hours now and I need 
help:
I need the a linker that is capable of delayed DLL loading and 
apparently, OPTLINK does not provide this option.

unilink and Microsofts incremental linker support it so I would 
like to use one of them but I cannot manage to get it to work.. :/

When I try to replace the OPTLINK Linker with set LINKCMD=... 
then dub still tries to use the default argument list from 
OPTLINK, that obviously does not work with other Linkers.

So what am I doing wrong?
Nov 15 2014
parent Mike Parker <aldacron gmail.com> writes:
On 11/16/2014 6:46 AM, univacc wrote:
 Hi,

 I am sitting in front of this problems for hours now and I need help:
 I need the a linker that is capable of delayed DLL loading and
 apparently, OPTLINK does not provide this option.

 unilink and Microsofts incremental linker support it so I would like to
 use one of them but I cannot manage to get it to work.. :/

 When I try to replace the OPTLINK Linker with set LINKCMD=... then dub
 still tries to use the default argument list from OPTLINK, that
 obviously does not work with other Linkers.

 So what am I doing wrong
When compiling a 32-bit executable with DMD on Windows, you get OPTLINK by default. This has nothing to do with dub. You can use the MS linker by compiling a 64-bit exe (-m64), provided you have it installed and DMD is properly configured to use it. Also, I've read somewhere on here about support for the MS linker in 32-bit DMD with a special flag (-ms32coff IIRC), but I'm not sure if it's in the latest beta or what. A search of the newsgroup should turn something up for you if someone else doesn't give you the right answer first.
Nov 16 2014