On 09/03/2017 11:19 PM, WebFreak001 wrote:
I tried using core.sys.windows.winldap (winldap.h) but I get linker
errors when I try to run my code. I tried copying Wldap32.lib from my
Windows Kits folder but then optlink always says Error 43 Not a Valid
Library File.

I simply use `dub test` to compile, adding `"libs": ["Wldap32"]` only
adds `Warning 2: File Not Found Wldap32.lib`

OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_initW
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _LdapGetLastError
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_unbind_s
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_set_optionW
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_get_optionW
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_msgfree
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_search_ext_sW
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_first_entry
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_next_entry
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_value_free_len
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_memfreeW
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_get_dnW
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_next_attributeW
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_get_values_lenW
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ldap_first_attributeW
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ber_free
.dub\build\ldap-test-library-unittest-windows-x86-dmd_2073-5D0B47894B8410C065D6A470FD54839E\ldap-test-library.obj(ldap-test-library)

 Error 42: Symbol Undefined _ber_bvfree
Error: linker exited with status 17

(I'm not actually logged in here right now, using guest to post this)

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!

Reply via email to