Platform SDK: Active Directory, ADSI, and Directory Services

Compiling and Linking

Define the LDAP version for your application by calling ldap_set_option with LDAP_OPT_VERSION and the appropriate option value. The default value is LDAP_VERSION2.

The header file winldap.h contains declarations for the Microsoft® implementation of the LDAP API. You will also need to include the header file winsock2.h to bring in protocol and connection definitions.

Link to the LDAP import library wldap.dll.

DLL: %systemroot%\system32\wldap32.dll

LIB: wldap32.lib

Make sure the client application can find the library by