LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   RedHat3.0: problem when compiling C++ code using the 'ldap' structure (https://www.linuxquestions.org/questions/linux-software-2/redhat3-0-problem-when-compiling-c-code-using-the-ldap-structure-362720/)

WuKitty 09-12-2005 01:52 PM

RedHat3.0: problem when compiling C++ code using the 'ldap' structure
 
Hi all,


I am trying to compile some C++ code using LDAP on Linux, and I get
a quite "surprising" error:
the 'ldap' structure is not defined in the system headers !
(see .../include/ldap.h (line 501): "typedef struct ldap LDAP;")


Here is the related code:
----------------------------------------------------------------------------
#include <lber.h>
#include <ldap.h>

...
LDAP* l_ldap;
char* l_msg = ldap_err2string(l_ldap->ld_errno ); (line 217)
...
----------------------------------------------------------------------------

and its results:
----------------------------------------------------------------------------
LDAPFactory.cpp: In member function `virtual Ldap::LDAPReturn LDAPFactory::add(char*, char*)':
LDAPFactory.cpp:217: error: invalid use of undefined type `struct ldap'
/usr/include/ldap.h:501: error: forward declaration of `struct ldap'
----------------------------------------------------------------------------


Did anybody experience a similar problem with the RedHat3.0 distribution?
Is there any additional header needed?


Thanks for your help


All times are GMT -5. The time now is 04:53 AM.