
April 7th, 2008, 04:27 AM
|
|
Registered User
|
|
Join Date: Apr 2008
Posts: 2
Time spent in forums: 34 m 55 sec
Reputation Power: 0
|
|
|
Linking with LDAP C library
Hi everyone,
i'm trying to create a connector for my application to connect with ldap, but i'm stuck apparently because of a library version problem.
Here's the whole story.
I've downloaded the mozilla C SDK 2.4, and tried to create my app. I've included the headers, the lib files, and modified my makefile so the libraries of the sdk are used to link.
The compilation process goes fine, but the linker exits in error and prints hundred of errors like
getattr.o(.text+0xc6): undefined reference to `ber_scanf'
getattr.o(.text+0xda): undefined reference to `ber_set_option'
getattr.o(.text+0x110): undefined reference to `ber_free'
getattr.o(.text+0x13c): undefined reference to `ber_scanf'
Thing is, i have no object called getattr in my code, so i assume it is one of the ldap library.
Since i have ldap installed on the computer, i tried to compile with the files already installed on my system. In that case, the compiler throws errors, apparently the ldap.h in my usr/include is too old.
Another test i made is to compile using the sdk header and my usr/lib library. In that case, it works fine, but it seems a bit dirty to create an app like that.
Next step, i thought of upgrading the machine: it was running on a 2.4.9 kernel, which is quite old, i imagine it could be a libc version mismatch. I upgraded to a 2.4.21, and tried to recompile, hoping that it would solve my issue, but it did not, i have exactly the same behavior.
I even tried to download another sdk, a newer one, but it didn't work.
I'm quite lost here, i don't understand why i get these errors. What are these ber functions that the library uses and that my systems doesn't know ? Why don't i have the same errors when using the usr/lib library ?
Any help is highly appreciated.
(for information, i only have this issue with linux. I'm compiling the same code on hp, aix, windows, solaris without problem.)
edit: more info
I'm linking using static libraries
|