[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Authentication / C file



ldap_init is from netscape's ldap sdk. in openldap you use ldap_open.
please RTFM.

Samson Bisaro wrote:
> 
> Hi ,
> i submit my problem.
> Im writing a c file to make an LDAP authentication :
> 
> #include<stdio.h>
> #include<lber.h>
> #include<ldap.h>
> ....
> int connexion(void)
> {
> if ( ( ld = ldap_init( ldap_host, LDAP_PORT) ) == NULL )
> {   perror ( "ldap_init" );
>     return ( 1 );
> }
> }
> ...
> 
> int authentication(void)
> {
> if ( ldap_simple_bind_s( ld, dn, pw ) != LDAP_SUCCESS )
> { ldap_perror( ld, "ldap_simple_bind_s" );
>   return( 1 );
> }
> }
> ...
> 
> but when i compile this file a get the following message :
> 
> /tmp/cca139941.o: In function `connexion':
> /tmp/cca139941.o(.text+0x10): undefined reference to `ldap_init'
> /tmp/cca139941.o: In function `authentication':
> /tmp/cca139941.o(.text+0x56): undefined reference to `ldap_simple_bind_s'
> /tmp/cca139941.o(.text+0x6f): undefined reference to `ldap_perror'
> 
> Any clue ?
> Thanks
> Samson Bisaro
> 
> --
> 
>         \\\|///
>       \\  - -  //
>        (  @ @ )
> ----oOOo--(_)-oOOo---------------------
> 
>       Samson BISARO
>       http://www.uhp.u-nancy.fr/RRI
> 
> ---------------Ooooo-------------------
>                (   )
>       ooooO     ) /
>       (   )    (_/
>        \ (
>         \_)

-- 
---------------------------------------------------------------------------
Svante Sörmark | Chalmers University IT systems & services |
+46-31-7728665
---------------------------------------------------------------------------