LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Berkeley DB (Which Lib to link?) (https://www.linuxquestions.org/questions/programming-9/berkeley-db-which-lib-to-link-418561/)

paulsm4 02-27-2006 12:03 PM

Hi -

That's kind of a weird place for it (I'd expect to find it someplace like "/usr/lib" or "/usr/local/lib"), but have you tried something like this:
Code:

g++ -o try db_try.cpp \
  -L/root/Desktop/db-4.4.20/build_unix/.libs/ -ldb-4 -ldb_cxx-4

Your "libdb_cxx-4.so" should probably be a symbolic link, to something like "libdb_cxx-4.3.so". If you installed it from RPM or built it from scratch, the symbolic link should be there.

'Hope that helps .. PSM

lucky6969b 02-27-2006 09:49 PM

Dear Paul,
I have tried your suggestions. For this time being, it's still looking for exception.h, From another Linux Media, someone suggested me to look for <stdexpt.h> which is standardised C++ stuff instead of using exception.h , but exception.h error only appears on Berkeley DB code, not mine. So I'm still confused.
Thanks
Jack

lucky6969b 02-28-2006 03:28 AM

Dear Paul,
I have found a workaround. That's to #define STD_CXX_HEADERS 1 in the file in question.
Thanks for helping me
Jack

Hko 03-02-2006 11:48 AM

Quote:

Originally Posted by lucky6969b
I have that file
./root/Desktop/db-4.4.20/build_unix/.libs/libdb_cxx-4.4.so
What should I be doing next?

Install the libs in a more suitable place, eg. /usr/local/bin. Or better yet, install the libs from a packageof your distro. Then link.

tag 05-19-2009 09:15 AM

Hey guys,

So, I have just got this working, figured I would shed some light on this, even if it is an old thread, I had this issue.

You are calling a C++ library, but linking to the C library. That is all well and good, but you need to also link to the C++ library. doing:

#define STD_CXX_HEADERS 1

will link ( I am not sure, but that sounds right, according to a previous post )

But, the simple fix is to add

-ldb_cxx

to your build library flags. This is on Debian / Ubuntu, just because of the current similink that ref's the most current lib.

Cheers! Hope it works!

Tag


All times are GMT -5. The time now is 11:16 AM.