[Bug 73477] Berkely DB <= 4.1 required? (Its hard to obtain Berkely DB <= 4.1 !)

Harald Fernengel harry at bnro.de
Tue Jan 27 21:03:05 UTC 2004


Hi,

Florian Schanda wrote:
> On Monday January 26 2004 20:55, Harald Fernengel wrote:
> 
>>------- Just read the logfile:
>>
>>conftest.cc: In function `int main()':conftest.cc:56: warning: 'db' might
>>be used uninitialized in this function/usr/bin/../lib/libdb.so: undefined
>>reference to `pthread_condattr_setpshared'/usr/bin/../lib/libdb.so:
>>undefined reference to `pthread_mutexattr_destroy'/usr/bin/../lib/libdb.so:
>>undefined reference to
>>`pthread_mutexattr_setpshared'/usr/bin/../lib/libdb.so: undefined reference
>>to `pthread_mutexattr_init'/usr/bin/../lib/libdb.so: undefined reference to
>>`pthread_mutex_trylock'collect2: ld returned 1 exit status
>>
>>your libdb.so contains unresolved references, it cannot be used by
>>KDevelop. In future, please use the mailing-list to post build errors.
> 
> 
> If I do 
> 	ldd /usr/lib/libdb.so
> I get no unresolved things:
>         linux-gate.so.1 =>  (0xffffe000)
>         libc.so.6 => /lib/libc.so.6 (0x400d4000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> 
> It is however not linked to pthread for some reason... Compiling & installing 
> db again does not fix this problem.
> 
> However, the command line for the configure check is:
> g++ -o conftest -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W 
> -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE 
> -Wcast-align -Wconversion -Wchar-subscripts -DNDEBUG -DNO_DEBUG -O2 -O3 
> -march=pentium4 -mtune=pentium4 -Wformat-security -Wmissing-format-attribute 
> -fno-exceptions -fno-check-new -fno-common  -ldb  -DQT_THREAD_SUPPORT  
> -D_REENTRANT -s conftest.cc
> 
> This lacks a -lpthread; adding this will make the the test-program compile.

That's the problem - your berkeley db library does not link to pthread 
although it uses symbols from pthread. Look at the little example 
program we're compiling - it just includes one header file. If you run 
"nm" on the libdb.so, you should get unresolved symbols in the library 
because it is not linking to pthreads.

Harald




More information about the KDevelop-devel mailing list