dbTalk Databases Forums  

mingw problem compiling example

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


Discuss mingw problem compiling example in the comp.databases.berkeley-db forum.



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

Default mingw problem compiling example - 02-15-2006 , 06:49 PM






I had no problem building db-4.4.20 on mingw (current version) - I used
"configure --enable-mingw" as in the FAQ -, but I'm having linker
errors building any program that uses it. For example, if I try to
build AccessExample.cpp (picked at random) from the examples_cxx
folder, using this command line (which may be wrong - please correct
me!)...

g++ AccessExample.cpp -mms-bitfields -DHAVE_CXX_STDHEADERS
-I/include/db-4.4 -L/lib/db-4.4 -ldb-4.4 -o test

....I get lots of errors like:
C:/DOCUME~1/Jeff/LOCALS~1/Temp/ccCedaaa.o:AccessExample.cpp.text+0x3c8):
undefined reference to `Db:b(DbEnv*, unsigned int)'

The paths are all right - I've copied the /usr/local/Berkeley
DB.4.4/include and lib folders to /include/db-4.4 and /lib/db-4.4.

Any suggestions? Anything I can do to further diagnose this?

Thanks!


Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: mingw problem compiling example - 02-15-2006 , 07:37 PM






Hi Jeff,

Quote:
g++ AccessExample.cpp -mms-bitfields -DHAVE_CXX_STDHEADERS
-I/include/db-4.4 -L/lib/db-4.4 -ldb-4.4 -o test

...I get lots of errors like:
C:/DOCUME~1/Jeff/LOCALS~1/Temp/ccCedaaa.o:AccessExample.cpp.text+0x3c8):
undefined reference to `Db:b(DbEnv*, unsigned int)'
This is unrelated to mingw. The C++ API to Berkeley DB is put in a
library called libdb_cxx-X.X, so your compile line should be:

g++ AccessExample.cpp -mms-bitfields -DHAVE_CXX_STDHEADERS \
-I/include/db-4.4 -L/lib/db-4.4 -ldb_cxx-4.4 -o test

Regards,
Michael.



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

Default Re: mingw problem compiling example - 02-16-2006 , 05:40 PM



Hi Michael,

Thanks, that did it.

Jeff


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.