[odb-users] Linking problem at Ubuntu 16.04

Martin Schneider martin at mu-schneider.de
Mon May 30 13:55:35 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

Hi Boris,

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

but then a lot of deprecate warnings like:
../../libcommon/common/common.hxx:42:15: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]

and finally a stopping error appears:

g++ -DHAVE_CONFIG_H   -I'../../libcommon' -I'../../libcommon' -I'.' -I'.'   -std=c++11 -D_REENTRANT  -MT test-odb.o -MD -MP -MF $depbase.Tpo -c -o test-odb.o test-odb.cxx &&\
mv -f $depbase.Tpo $depbase.Po
test-odb.cxx: In static member function ‘static void odb::access::object_traits_impl<test3::object2, (odb::database_id)0u>::init(odb::access::object_traits<test3::object2>::object_type&, const odb::access::object_traits_impl<test3::object2, (odb::database_id)0u>::image_type&, odb::database*)’:
test-odb.cxx:2367:14: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = test3::object1; _Dp = std::default_delete<test3::object1>]’
        o.p2 (v);
               ^
In file included from /usr/include/c++/5/memory:81:0,
                  from test.hxx:13,
                  from test-odb.hxx:16,
                  from test-odb.cxx:7:
/usr/include/c++/5/bits/unique_ptr.h:356:7: note: declared here
        unique_ptr(const unique_ptr&) = delete;
        ^
In file included from test-odb.hxx:16:0,
                  from test-odb.cxx:7:
test.hxx:287:10: note:   initializing argument 1 of ‘void test3::object2::p2(test3::object1_ptr)’
      void p2 (object1_ptr p2) {p2_ = std::move (p2);}
           ^
Thanks
Martin






More information about the odb-users mailing list