Knowledge Base

PRB: Error C2501 When Building Application Using Winldap.h

Article ID: 201027

Article Last Modified on 3/20/2004


APPLIES TO


This article was previously published under Q201027

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 kbprb kbdswmanage2003swept KB201027