Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 11, 2014 Using the Windows' compiler/linker how to specify a library to link? | ||||
---|---|---|---|---|
| ||||
I'm currently using the 32bit compiler on Windows which uses optlink for linking. I know the compiler command line accepts the -L option to pass arguments to the linker. So what i'm after is the correct way to pass an option to optlink to link a defined library. On Linux i would use: dmd -L-Llocation -L-lmylib source.d but on Windows? |
January 11, 2014 Re: Using the Windows' compiler/linker how to specify a library to link? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On 1/11/2014 9:01 PM, Gary Willoughby wrote:
> I'm currently using the 32bit compiler on Windows which uses optlink for
> linking. I know the compiler command line accepts the -L option to pass
> arguments to the linker. So what i'm after is the correct way to pass an
> option to optlink to link a defined library.
>
> On Linux i would use: dmd -L-Llocation -L-lmylib source.d
>
> but on Windows?
dmd -L+location mylib.lib source.d
|
January 11, 2014 Re: Using the Windows' compiler/linker how to specify a library to link? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | On Saturday, 11 January 2014 at 12:57:38 UTC, Mike Parker wrote:
> On 1/11/2014 9:01 PM, Gary Willoughby wrote:
>> I'm currently using the 32bit compiler on Windows which uses optlink for
>> linking. I know the compiler command line accepts the -L option to pass
>> arguments to the linker. So what i'm after is the correct way to pass an
>> option to optlink to link a defined library.
>>
>> On Linux i would use: dmd -L-Llocation -L-lmylib source.d
>>
>> but on Windows?
>
> dmd -L+location mylib.lib source.d
Thanks. So simple but hard to find any docs.
|
January 11, 2014 Re: Using the Windows' compiler/linker how to specify a library to link? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On 1/11/2014 10:08 PM, Gary Willoughby wrote: > On Saturday, 11 January 2014 at 12:57:38 UTC, Mike Parker wrote: >> On 1/11/2014 9:01 PM, Gary Willoughby wrote: >>> I'm currently using the 32bit compiler on Windows which uses optlink for >>> linking. I know the compiler command line accepts the -L option to pass >>> arguments to the linker. So what i'm after is the correct way to pass an >>> option to optlink to link a defined library. >>> >>> On Linux i would use: dmd -L-Llocation -L-lmylib source.d >>> >>> but on Windows? >> >> dmd -L+location mylib.lib source.d > > Thanks. So simple but hard to find any docs. True. I could never remember the -L+ bit. Google led me here a while back: http://prowiki.org/wiki4d/wiki.cgi?D__Tutorial/CompilingLinkingD |
Copyright © 1999-2021 by the D Language Foundation