Microsoft KB Archive/201027

{|
 * width="100%"|

PRB: Error C2501 When Building Application Using Winldap.h

 * }

Q201027

-

The information in this article applies to:


 * Microsoft Active Directory Service Interfaces, version 2.0

-

SYMPTOMS
When you are building an application that includes the file Winldap.h, the following error might occur:

error C2501: 'PCONTEXT' : missing decl-specifiers

CAUSE
The definition of PCONTEXT is conditionally compiled based on the definition of architecture preprocessor symbols, which indicate the type of the target computer. If no architecture symbol is defined, later references to PCONTEXT in the header files will fail.

RESOLUTION
Do one of the following to resolve this problem:


 * Include the file Windows.h before Winldap.h.
 * Define the architecture preprocessor symbol for your system (_X86_ or _ALPHA_). This is the reason that this problem does not occur when you build using the make file that is provided with the Platform SDK.

Additional query words: kbLDAP

Keywords : kbnetwork kbADSI kbSDKPlatform

Issue type : kbprb

Technology : kbAudDeveloper kbADSISearch kbADSI200