ldap bind error

hi

Using C program i am trying to connect to ldap server i have used the method bind
syntax :
ldap_bind_s(ld,"cn=Manager,dc=example,dc=com","password")

but it is not able to bind and giving error as
error 2 :Historical protocol version required use ldapv3 instead

do i need to add any other header file other than this
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <lber.h>
#include <ldap.h>

can any one please tell me how should i overcome this error

for c programming in ldap environment what all this required

thankx

LDAP has two versions in use: v2 and v3. v2 is essentially obsolete as most servers already go v3. It seems like your client LDAP library is speaking v2 protocol when the server expects v3. I don't have experience invoking LDAP with C programming though I have used LDAP for some time with PHP and command line in the past. Normally, the API should let you specify which protocol to use. Try to see if you can find the relevant flag.

Hi Mridula,
what version are you using. As per the info I have ldap_bind_s takes 4 arguments, I see you are using 3 arguments. My knowledge on this is less, but wonder if this is some other version of ldap library that allows you this function?