- 论坛徽章:
- 0
|
非常感谢您的帮助。我照下面的做,可是仍然有错。不知我哪里是否有误?
#ifdef __cplusplus
extern "C" {
#endif
#include <ldap.h>
#ifdef __cplusplus
}
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
int main(int argc, char* argv[])
{
.....
ldap_init(ldap_host,LDAP_PORT);
....
}
编译: g++ -c test.cpp -o test
出错:test.cpp: In function `int main(int, char**)':
test.cpp:68: `ldap_init' undeclared (first use this function)
test.cpp:68: (Each undeclared identifier is reported only once for each
function it appears in.) |
|