[odb-users] Linux Linking ODB - libtool vs g++

Boris Kolpackov boris at codesynthesis.com
Mon Aug 29 12:50:18 EDT 2011


Hi Thomas,

Szumowski, Thomas <thomas.szumowski at lmco.com> writes:

> I was following the example in the ODB user manual section 2.3 "Compiling
> and Running". I am on a linux machine. I noticed when I get to the point of
> running the equivalent command "c++ -o driver driver.o person-odb.o
> -lodb-mysql -lodb", I get an error. But when I run the make in the examples
> (hello), it runs libtool and I get no errors. See below for my
> results. First I link using libtool, as done in the makefile. That works
> fine and I can execute the program. But then I try the line in the user
> manual and it fails. Any recommendations? 

Hm, this is strange. I don't get this error. It looks like libodb-sqlite.so
is not linked to libsqlite3.so. Can you try this command line and see if
there is an entry for libsqlite3.so in the output:

ldd /usr/local/lib/libodb-sqlite.so

One explanation for this behavior would be if you didn't have a shared
version (.so) of libsqlite3, only static (libsqlite3.a). The output from
the above command line should shed some light on this as well.

Also, I assume that you have built and installed libodb-sqlite (and
libodb) using something like this:

$ ./configure
$ make
$ sudo make install

Another thing that could be helpful is if you could send me your 
/usr/local/lib/libodb-sqlite.la so that I could compare it mine.


> And should I just always use libtool to build?

You can, but you definitely shouldn't have to. I can build the hello
example using just the g++ command line without any problems.

Boris



More information about the odb-users mailing list