Linking C libraries with DMD

jmh530 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 21 14:09:47 PST 2016


On Thursday, 21 January 2016 at 22:02:57 UTC, Dibyendu Majumdar 
wrote:
> On Thursday, 21 January 2016 at 21:55:10 UTC, jmh530 wrote:
>>>
>>> For the latter - on Windows 10 b64-bit - I am using following 
>>> options for example:
>>>
>>> -shared -L/LIBPATH:c:\\lib  -L//IMPLIB:mylib.lib
>>>
>>
>> I'm not having any luck using your options with dmd either 
>> (excluding -shared because I don't need to create a shared D 
>> library).
>
> Sorry forgot to mention that I also include the library I am 
> linking to. Example:
>
> dmd -m64 prog.d -L/LIBPATH:c:\lib -Lyourlib.lib
>
> Where yourlib.lib and yourlib.dll are in c:\lib folder.

The -L/LIBPATH:c:\lib gives me an error that
OPTLINK : Warning 9: Unknown Option : LIBPATH
and then gives the path I put is not found.

At least when it's outputting the text, it's combining
:C:\lib\yourlib.lib
so it seemingly is finding it.


More information about the Digitalmars-d-learn mailing list