سؤال

i'm trying to compile a c program using the berkeley db library (libdb) on ubuntu but the program doesn't link - gcc reports a missing dbopen reference.

db_ops.c:(.text+0x5c): undefined reference to `dbopen' collect2: ld returned 1 exit status make: * [cdrutil] Error 1

This is driving me crazy because it looks the db library v4.8 is installed (but I don't know where thanks to brilliant package management in ubuntu)

These packages are listed with apt-cache showpkg:

  • libdb4.8-dev
  • libdb4o8.0-cil
  • libdb4.8

and my compiler commandline is:

gcc -D_FILE_OFFSET_BITS=64 -ldb -o cdrutil main.c cdr_ops.c db_ops.c

(i tried also -ldb4.8, -ldb-4.8 and few others but no success)

HELP me people - how to install that freaking library in ubuntu? And why doesn't it work out of the box, is this some rocket science or what?

هل كانت مفيدة؟

المحلول

Ok, I found the answer: dbopen function was supported in old versions of Berkeley db. Now you're supposed to use DB->open. Ubuntu man pages are outdated in this respect.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top