Linking to a library via the linker on Windows?

Jeremy DeHaan dehaan.jeremiah at gmail.com
Wed Nov 20 00:01:06 PST 2013


On Wednesday, 20 November 2013 at 07:47:39 UTC, Ali Çehreli wrote:
> On 11/19/2013 11:18 PM, Jeremy DeHaan wrote:
>> Like I said in the title, this is related to Windows. 
>> Basically, I'm
>> looking to put a command line together to keep things 
>> consistent between
>> Windows, OSX and Linux.
>>
>> On OSX and Linux I would do -L-lLibraryName, but is there 
>> something
>> similar that one can do on Windows? Or do I have to add 
>> LibraryName.lib
>> to the file list? Just wondering!
>
> It looks like it is -L on Windows as well:
>
>   http://dlang.org/dmd-windows.html
>
> Ali

The -L switch is just for sending switches to the linker. On OSX 
and Linux, it is -L-lLibraryName, like I mention before, where 
-lLibraryName is what actually gets passed to the linker. 
Basically I'm wondering of Optlink has a switch that does the 
same thing as the -l switch for linking to a library.


More information about the Digitalmars-d-learn mailing list