|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
C + + c procedures can directly transfer function?
I c and is not very familiar with C + +. LDAP api wants to use C + + function. But we do not know why, c documents are available ldap function, and C + + can not transfer procedures. Hope you pass the heroes to help out in the end to tell me how to do? |
#ifdef __cplusplus
Extern "C" (
#endif
/*...*/
#ifdef __cplusplus
}
#endif
#endif
Notes add ldap in the first document. |
Thank you very much for your help. Now as I do, but still wrong. Where, I do not know whether there was a mistake?
#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);
....
}
Translation : Linux-c test.cpp -o test
Test.cpp : In function `int main mistakes : (int, char**) ':
Test.cpp:68 : `ldap_init 'undeclared (first use this function)
Test.cpp:68 : (Each undeclared identifier is reported only once for each
It appears in function. ) |
3rd Floor wenziyan reply to the message Man ldap_init
Find where your library installed ldap |
Facts have proved location is no problem. I finally resolved in a stupid way is to be deployed on a c ldap_init operating procedures, and then call the C + + c procedures adopted procedures to achieve my aim. Thank you for your help. |
| |