[dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries?

Rainer Schuetze r.sagitario at gmx.de
Mon Aug 16 04:41:04 PDT 2010


Walter Bright wrote:
> 
> 
> mrmocool at gmx.de wrote:
>>>     -L-Lpath
>>> works for me on Linux.
>>
>> Well good old friend optlink doesn't support something like that. And 
>> the LIB variable is overwritten by the content specified in sc.ini I 
>> think.
>>
> 
> dmd will pass any switch directly to the linker with the -L command. I 
> know optlink has a problem with lib paths, but such is not fixable by 
> enhancing pragmas, but by enhancing optlink.

dmd could add a library search path for optlink by adding it to the LIB 
environment variable. The work-around for Visual D is to manually modify 
sc.ini, appending %DMD_LIB% to the respective line and passing 
additional paths through that environment variable when building.

(BTW: LIB is a dangerous environment variable for optlink because it is 
widely used by other compilers, and libraries of unsupported formats can 
cause optlink to fail without reporting an error.)

If modifying optlink is such a hassle, it would be nice if dmd could 
modify the LIB environment variable from a command line switch.

Rainer

ps: I tried to send this message before through gmane, but was not 
subscribed to the list, so it did not seem to get through. sorry if it 
is a duplicate now.



More information about the dmd-internals mailing list