I'm trying to install a program using Berkeley DB. it is simply inclyded to the .h file like that:
#include <db_cxx.h>
g++ version 4.1.1
However, compiling it on my Fedora 6 system (I've also tried to do it on Ununtu 6 system), I get the following error:
LanguageModelSAMT.o: In function `CDatabaseSAMTLM::CDatabaseSAMTLM(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
LanguageModelSAMT.cc
.text+0x212): undefined reference to `Db:
b(DbEnv*, unsigned int)'
LanguageModelSAMT.o: In function `CDatabaseSAMTLM::CDatabaseSAMTLM(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
LanguageModelSAMT.cc
.text+0x372): undefined reference to `Db:
b(DbEnv*, unsigned int)'
collect2: ld returned 1 exit status
make: *** [FastTranslateChart] Error 1
the corresponding makefile part is:
CXX = g++
CXXFLAGS = -D_REENTRANT -DNDEBUG -O2 -I./src/Share -I./src/LM -I./src/BleuSearch
-I./src/Lattice -I./src/SRI -I./src/FORTFY22 -I/usr/local/programs/BDB-4.5.20.N
C//include/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_ST
DLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_
H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DSTDC_HEADERS=1 -DHAVE
_STACK=1 -DHAVE_STRING=1 -DHAVE_LIST=1 -DHAVE_VECTOR=1 -DHAVE_MAP=1 -DHAVE_EXT_H
ASH_MAP=1 -DHAVE_EXT_HASH_SET=1 -DHAVE_ZOPEN -DINSTANTIATE_TEMPLATES
LD_FLAGS = -L/usr/local/programs/BDB-4.5.20.NC//lib/ -ldb_cxx
Looks like a mismatch between the Berkeley DB 4.5.20.NC that I'd like to use and pre-installed older Berkeley DB included to the Linux distribution.
I tried to include the path to the correct libraries to LD_LIBRARY_PATH and compile the module with -D_REENTRANT flag. no changes
probably, someone faced with similiar problem?