core.sys.windows.winldap

rikki cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Mar 9 03:15:29 PST 2017


On 09/03/2017 11:52 PM, WebFreak001 wrote:
> On Thursday, 9 March 2017 at 10:44:00 UTC, rikki cattermole wrote:
>> On 09/03/2017 11:19 PM, WebFreak001 wrote:
>>> ...
>>
>> Import libs like static libraries adhere to the same specs of PE-COFF
>> versus OMF.
>>
>> So if you want things to work without much hassle, hello -m64!
>
> Thanks, adding `--arch=x86_mscoff` to the dub call and then also adding
> `"libs": ["wldap32"]` fixed it. Is there a way to force dub to use that
> architecture? I could add it as dflags argument but then it outputs a
> warning that I should use --arch instead. I don't want users of my
> library to have that linker error

Looks like you either have to make a .defs file manually or create/find 
a OMF based import lib.

I did find this[0] no idea if it'll work with Optlink without changes.

FYI .defs file is nice since Optlink will recognize it but MSVC link 
won't. Example[1] note that dxva2 has a .def file in same directory but 
it will work for all Windows builds since MSVC provides its own import lib.

[0] 
https://sourceforge.net/u/earnie/winapi/winapi/ci/f9fa22a4ecce88ad12a8371a40f00ef702ec3e1b/tree/lib/wldap32.def
[1] https://github.com/Devisualization/spew/blob/master/dub.json#L34


More information about the Digitalmars-d-learn mailing list