cmake 构建问题:对“std::__cxx11::basic_string”未定义的引用,std::分配器

cmake 构建问题:对“std::__cxx11::basic_string”未定义的引用,std::分配器

我正在尝试按照以下方式构建一些提供的 C++ 示例本教程建议采取以下步骤:

cd dlib/examples
mkdir build
cd build
cmake .. 
cmake --build . --config Release

问题是执行时cmake --build . --config Release出现以下错误:

    yalishanda-thinkpad-x200:~/DLIB/dlib-19.4/examples/build$ cmake --build . --config Release
    [ 23%] Built target dlib
    Scanning dependencies of target sqlite_ex
    [ 23%] Linking CXX executable sqlite_ex
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) [clone .isra.60]':
    sqlite_ex.cpp:(.text+0x83): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `table_exists(dlib::database&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
    sqlite_ex.cpp:(.text+0x10a): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)'
    sqlite_ex.cpp:(.text+0x137): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> 
>::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text+0x6fc): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o:sqlite_ex.cpp:(.text+0x73c): more undefined references to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' follow
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `dlib::randm(long, long)':
    sqlite_ex.cpp:(.text._ZN4dlib5randmEll[_ZN4dlib5randmEll]+0xd3): undefined reference to `__cxa_throw_bad_array_new_length'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)':
    sqlite_ex.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_]+0xa1): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)'
    sqlite_ex.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_]+0xd1): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)':
    sqlite_ex.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_]+0x23): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
    sqlite_ex.cpp:(.text._ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEED2Ev[_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEED5Ev]+0x7): undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()':
    sqlite_ex.cpp:(.text._ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEED0Ev[_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEED5Ev]+0x7): undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `dlib::statement::statement(dlib::database&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
    sqlite_ex.cpp:(.text._ZN4dlib9statementC2ERNS_8databaseENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4dlib9statementC5ERNS_8databaseENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xfc): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `dlib::database::exec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
    sqlite_ex.cpp:(.text._ZN4dlib8database4execERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4dlib8database4execERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1ef): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text._ZN4dlib8database4execERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4dlib8database4execERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2fd): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text._ZN4dlib8database4execERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4dlib8database4execERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x344): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text._ZN4dlib8database4execERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4dlib8database4execERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x3e9): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x9e): undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0xde): undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0xea): undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x15f): undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x3b0): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x3de): undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned long, unsigned long)'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x56b): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x58d): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x5c9): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x5eb): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x672): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x719): undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x725): undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x731): undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x768): undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x76f): undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x7ef): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x813): undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE[_ZN4dliblsINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEERSoS6_RKNS_10matrix_expIT_EE]+0x81a): undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `void dlib::statement::bind_object<dlib::matrix<double, 0l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout> >(unsigned long, dlib::matrix<double, 0l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout> const&)':
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x4a): undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x5c): undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0xd2): undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0xde): undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x14f): undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x307): undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x313): undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x31f): undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x349): undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x493): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x4ab): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x4eb): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x50d): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x57a): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x750): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()'
    sqlite_ex.cpp:(.text._ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_[_ZN4dlib9statement11bind_objectINS_6matrixIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEvmRKT_]+0x77b): undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `void dlib::deserialize<double, 0l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout>(dlib::matrix<double, 0l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout>&, std::istream&)':
    sqlite_ex.cpp:(.text._ZN4dlib11deserializeIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEvRNS_6matrixIT_XT0_EXT1_ET2_T3_EERSi[_ZN4dlib11deserializeIdLl0ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEvRNS_6matrixIT_XT0_EXT1_ET2_T3_EERSi]+0xa10): undefined reference to `__cxa_throw_bad_array_new_length'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `main':
    sqlite_ex.cpp:(.text.startup+0x83): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    sqlite_ex.cpp:(.text.startup+0x2af): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)'
    sqlite_ex.cpp:(.text.startup+0x401): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0x648): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0x829): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    sqlite_ex.cpp:(.text.startup+0x8fa): undefined reference to `VTT for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0x90c): undefined reference to `VTT for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0x999): undefined reference to `vtable for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0x9a5): undefined reference to `vtable for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0xa1e): undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0xa9e): undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned long, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0xaf0): undefined reference to `vtable for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0xafc): undefined reference to `vtable for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0xb08): undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0xb33): undefined reference to `VTT for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0xd90): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0xddc): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0xe28): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0xf21): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0xf5d): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o:sqlite_ex.cpp:(.text.startup+0xfba): more undefined references to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' follow
    CMakeFiles/sqlite_ex.dir/sqlite_ex.cpp.o: In function `main':
    sqlite_ex.cpp:(.text.startup+0x117f): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)'
    sqlite_ex.cpp:(.text.startup+0x122f): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)'
    sqlite_ex.cpp:(.text.startup+0x1372): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0x15b4): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0x171c): undefined reference to `VTT for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >'
    sqlite_ex.cpp:(.text.startup+0x1994): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0x1ac3): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0x1b1b): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0x1c40): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
    sqlite_ex.cpp:(.text.startup+0x2299): undefined reference to `std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_istringstream()'
    collect2: error: ld returned 1 exit status
    CMakeFiles/sqlite_ex.dir/build.make:105: recipe for target 'sqlite_ex' failed
    make[2]: *** [sqlite_ex] Error 1
    CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/sqlite_ex.dir/all' failed
    make[1]: *** [CMakeFiles/sqlite_ex.dir/all] Error 2
    Makefile:83: recipe for target 'all' failed
    make: *** [all] Error 2

我该如何解决这个问题?

实际输出甚至更长一些:http://paste.ubuntu.com/25182486/我剪了一些碎片)

谢谢

编辑:

我尝试添加 SET(CMAKE_CXX_FLAGS“-D_GLIBCXX_USE_CXX11_ABI=0”)并设置(CUDA_USE_STATIC_CUDA_RUNTIME OFF)

在 CMakeLists.txt 文件的开头。但不幸的是,这并没有解决问题。

相关内容