PDA

View Full Version : LDAP programming question



blooddrunk
July 31st, 2008, 11:01 AM
Hi! I am programming using <ldap.h>. I've got the following problem: Every time I use a command like ldap_create() or ldap_open() or ldap_initialize() etc., I compile the program without problems. The when I start it, it doesn't'work properly and in /var/log/messages I read :"undefined symbol: ldap_create"

Thanks in advance

henchman
July 31st, 2008, 11:07 AM
Have you linked against the corresponding library? which compiler are you using?

if you are using gcc, then try



gcc foobar.c -lldap


this should work

blooddrunk
July 31st, 2008, 11:36 AM
Thank you!

blooddrunk
August 4th, 2008, 02:14 PM
I've done what was proposed above and it works but only for some of the functions in <ldap.h>. It still gives me "undefined symbol" for functions like ldap_kerberos_bind_s, for example. What should I do?

KingTermite
August 4th, 2008, 04:29 PM
I've done what was proposed above and it works but only for some of the functions in <ldap.h>. It still gives me "undefined symbol" for functions like ldap_kerberos_bind_s, for example. What should I do?

It sounds like whatever you are using for a reference might be using functions of a newer version of the library. You should check and see if the library on your machine (as well as header files) are the latest.

blooddrunk
August 4th, 2008, 04:42 PM
I did. And the funny thing is all that functions are in the library

KingTermite
August 4th, 2008, 10:33 PM
I did. And the funny thing is all that functions are in the library

Are you sure there isn't another (older version) on the machine that is also in your libpath (and before the location of your other one)?

blooddrunk
August 5th, 2008, 08:21 AM
I am not sure. How can I check that?