1833704 Members
2560 Online
110062 Solutions
New Discussion

ldap C Api compilation

 
mango_1
Frequent Advisor

ldap C Api compilation

Hello all! I was trying on a sample program I created using ldap c api calls named ltest1a.c. The thing is it works if I use the following line of code to compile it

cc -g -I $I $1 ltest1a.c -L$L -lldap50

But if I wanted to compile it with a static library like

cc -g -I $I $1 ltest1a.c -Wl,-E -ldld -lpthread -L$L -Wl,-a,archive -lldap50 -ll
ber50

I encounter the error
ldap_simple_bind_s: Can't connect to the LDAP server - No route to host.

Is it something wrong with the arguments I supplied if I wanted to statically link with ldap or is it something wrong with the archive itself? if so, how could you tell?

any help is much appreciated. thanks!