[odb-users] Linking problem at Ubuntu 16.04

Boris Kolpackov boris at codesynthesis.com
Sun May 29 21:25:27 EDT 2016


Hi Martin,

Martin Schneider <martin at mu-schneider.de> writes:

> ./configure --with-database=mysql
>
> [...]
>
> /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libodb-mysql.so:
> undefined reference to `odb::statement::process_insert(char const*,
> void const* const*, unsigned long, unsigned long, char,
> std::__cxx11::basic_string<char, std::char_traits<char>,
> std::allocator<char> >&)'
> /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libodb-mysql.so:
> undefined reference to `odb::statement::process_update(char const*,
> void const* const*, unsigned long, unsigned long, char,
> std::__cxx11::basic_string<char, std::char_traits<char>,
> std::allocator<char> >&)'
> /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libodb-mysql.so:
> undefined reference to `odb::statement::process_select(char const*,
> void const* const*, unsigned long, unsigned long, char, char, bool,
> std::__cxx11::basic_string<char, std::char_traits<char>,
> std::allocator<char> >&, bool)'
>
> [...]
>
> installed by:
> sudo apt-get install libodb-dev libodb-mysql-dev libodb-boost-dev
> libodb-qt-dev

Hm, looking at those 'std::__cxx11::basic_string' my suspicion is that
there is a C++98/C++11 mismatch. Normally, with libstdc++, a library
that was compiled with C++98 can be used with C++11. However, I am not
sure if the other way around also works, my guess would be it does not.
And it looks like libodb-mysql was compiled in the C++11 mode while
libodb was not.

You could try to configure your tests in C++11 though I am not sure
it will make any difference (it is the way libodb-mysql is build that
is the problem):

./configure --with-database=mysql CXXFLAGS=-std=c++11

I think we should dig into the libodb-mysql package and/or contact
its maintainer with this information.

Boris



More information about the odb-users mailing list