[odb-users] Netbeans build error

Bright Dadson losintikfos at yahoo.co.uk
Wed Feb 16 17:36:03 EST 2011


The project I attached in my initial post is pretty much all I have. I have gone 
through it thoroughly - and cannot see any duplicate inclusions. I can happily 
compile the the file individually and link them using: c++ -o driver driver.o 
person-odb.o -lodb-mysql -lodb on command line.

The issue occurs when I try to use the netbeans build facility.
Which outputs exception with few of them similar to this:

build/Debug/GNU-Linux-x86/Member-odb.o: In function 
`odb::access::object_traits<test::Member>::find(odb::database&, unsigned long 
const&, test::Member&)':
Member-odb.cxx:(.text+0xe33): undefined reference to 
`odb::mysql::transaction::current()'

The question is, can I have have netbeans do the build for me or I have to 
manually compile the files and link them via console!?





Hi Bright,

Bright Dadson <losintikfos at yahoo.co.uk> writes:

> Quick one though! I can compile Driver.cpp without any issues, but if i 
> right-click on the project name and select Build, I end up with below 
> exception. Do you know what what could be the issue?

Most likely you are linking-in the same object file twice or include
.cpp file somewhere instead of .h. I tried to compile and link (using
the g++ command line, not your project) just these three files: Member.cpp
Member-odb.cxx, and Driver.cpp, and everything links without any issues.

Boris



      


More information about the odb-users mailing list