dbTalk Databases Forums  

undefined reference to Db::Db()

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss undefined reference to Db::Db() in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MoeDogQ
 
Posts: n/a

Default undefined reference to Db::Db() - 01-09-2006 , 03:57 PM






I am a newbie to the Berkeley DB. I am getting this error when I try to
produce my outfile for a very simple C++ example file.

Here are my steps:
I am working on the latest version of RedHat;
I did the following to build the DB on my laptop:
From build_unix dir I did
[root@localhost build_unix]# make realclean
[root@localhost build_unix]# ../dist/configure --enable-cxx
[root@localhost build_unix]# make
[root@localhost build_unix]# make install

Here is my Berkeley Dir file listings:
/usr/local/BerkeleyDB.4.4/bin
db_archive db_deadlock db_hotbackup db_printlog db_stat
db_verify
db_checkpoint db_dump db_load db_recover db_upgrade

/usr/local/BerkeleyDB.4.4/include
db_cxx.h db.h

/usr/local/BerkeleyDB.4.4/lib
libdb-4.4.a libdb-4.4.so libdb.a
libdb-4.4.la libdb-4.so libdb.so
libdb_cxx-4.so libdb_cxx.so libdb_cxx-4.4.la
libdb_cxx-4.4.a libdb_cxx-4.4.so
libdb_cxx.a


Here is my program:
#include <db_cxx.h>

using namespace std;

int main(){
Db(NULL,0);
return (0);
}


Here are the commands I ran:

[root@localhost mydb]# g++ -c -I/usr/local/BerkeleyDB.4.4/include/
SearchThread.cpp
[no problem]

[root@localhost mydb]# g++ -o ciboreqt SearchThread.o
-L/usr/local/BerkeleyDB.4.4/lib/

HERE IS THE OUTPUT W/ ERRORS:

SearchThread.o(.text+0x28): In function `main':
SearchThread.cpp: undefined reference to `Db:b(DbEnv*, unsigned int)'
SearchThread.o(.text+0x37):SearchThread.cpp: undefined reference to
`Db::~Db()'
collect2: ld returned 1 exit status
[root@localhost mydb]#


The program is so simple and the concept is the same as any other
program, that I don't understand what the problem is with the linker.

PLEASE HELP


Reply With Quote
  #2  
Old   
Ron
 
Posts: n/a

Default Re: undefined reference to Db::Db() - 01-09-2006 , 05:03 PM






Try something like:
-L/usr/local/BerkeleyDB.4.4/lib/ -ldb_cxx-4.4

Ron


Reply With Quote
  #3  
Old   
MoeDogQ
 
Posts: n/a

Default Re: undefined reference to Db::Db() - 01-11-2006 , 01:33 PM



That worked, however, when I execute my outfile it gives me the error

../cibyre : error while loading shared libraries: libdb_cxx-4.4.so:
cannot open shared object file: No such file or directory

Any ideas on this one?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.