How use LDAP (search) from the C ?

How use LDAP (search) from the C ?

Where i can get examples ?

Serg

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Googling for ‘ldapsearch c++’ (without quotes) turned up a lot of
interesting stuff.

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPIYgmAAoJEF+XTK08PnB5buAP/2OcBl+5hfKl+OVfXQofZaI4
dTt6MhdFDv1tK+KlPTiLZIIsKotLxel9MULYaCF5vnRv1qUvif+4MOBSgaxk7eLp
2Cl1CvtL+MSX4r9l+bvvMFZ01XAP5I/u3CeQ3kzKFy0uTgbSn8Zv68voJ3AlKIsF
ZoibdTvZnHUqWRoPY1stTTQ4g3VHh5aScHk+g5747x+x1X9H7veq19z+to1OBtdU
WKpELhFUJ4TZcfv1bAc4EmcjV+YNE1aJnALQK4LYzSBrWHunCJ1PBzfmY5qIF570
EnKNRG7p6RdKFAgYGp4KC3WIAaBtYXiyOoKT+RA89LT02tlGIX3w7vzcMVlXLjoT
gTtrXn480VNwLR2FmA9Qvc7mOoZwvbFZcEMzRsWumPpIVAkw+5ChChsFWsoZlW3y
l0cu0KnlQ1l+TnjR+qlJ8JceQkGlwIfMNIUu9HxwFLv/n9eyeNTcLj7h/40eJW2S
wtkbzYPaQlPSeJGHT9YunMm0ZhtlcSS//BNtH8Vt0wn3vAqZ1DCEIrvG0tkQytZ8
eH1K1oJ2054syqGkane4WEnhyXnGChl/YvFz3HoYIaI06z8RZag59MeStJuTOJK2
yCh0OiKAG99harjGULTGheyR2sOJDgBeRco4kunh1LO9Sna8IcCEqocziA9s9LEn
w2MEjDGus5DTFbtGl91h
=5+Fr
-----END PGP SIGNATURE-----

Ok.
Download from this: ftp://sdk.provo.novell.com/ndk/cldap/builds/linux/novell-cldap-devel-2010.10.30-1linux.tar.gz
1)
Unpack in to the:
/home/user1/source/my
su copy /home/user1/source/my/cldapsdk/include /usr/local/include
su copy /home/user1/source/my/cldapsdk/lib /usr/local/lib
su ldconfig

  1. log as user1
    get from this sdk file: searchURL.c

#gcc searchURL.c -v

586-suse-linux/4.6/crtend.o /usr/lib/crtn.o
/tmp/ccFcmYUh.o: In function main': searchURL.c:(.text+0x62): undefined reference to ldap_is_ldap_url’

searchURL.c:(.text+0x66c): undefined reference to `ldap_free_urldesc’
collect2: ld returned 1 exit status

Can you help me ?

Serg

Am 26.01.2012 19:36, schrieb skoltogyan:
> #gcc searchURL.c -v

That cannot work, you do not link against any library.


PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
4.6.0 | GeForce GT 420 | 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
nVidia ION | 3GB Ram

Wich Librarys link and how ??

In the /usr/local/lib all files from …cldapsdk/lib

ksr@linux-pib8:~/Documents/sources/test> file /usr/local/lib/libldapssl.so.0.0.0
/usr/local/lib/libldapssl.so.0.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

Serg

Am 26.01.2012 20:36, schrieb skoltogyan:
>
> Wich Librarys link and how ??
>
> In the /usr/local/lib all files from …cldapsdk/lib
>
What about about reading the documentation?
I think you will at least need to link against ldapsdk with “-lldapsdk”.

The other question is, do you really need what you downloaded for your task?
What is not included in openldap and the ldap development libraries that
you need to use what you try to use?


PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
4.6.0 | GeForce GT 420 | 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
nVidia ION | 3GB Ram

On Thu, 26 Jan 2012 19:36:06 +0000, skoltogyan wrote:

> Wich Librarys link and how ??
>
> In the /usr/local/lib all files from …cldapsdk/lib
>
> Serg

It sounds like you need to step back from using LDAP libraries and learn
more about programming in C/C++ first. Linking against libraries is a
fundamental skill in writing and compiling C code.

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C