Error building OpenCV3.1 with CUDA on Ubuntu 15.10 [closed] - c++

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm trying to build OpenCV 3.1 on Linux (Ubuntu 15.10), but am getting the following errors:
cd /home/rob/Libraries/OpenCV3/opencv-3.1.0/build/modules/cudev/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/opencv_test_cudev.dir/link.txt --verbose=1
/usr/lib/ccache/c++ -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Winit-self -Wpointer-arith -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -Wno-undef -Wno-missing-declarations -Wno-unused-function -Wno-unused-variable -Wno-enum-compare -Wno-shadow -O3 -DNDEBUG -DNDEBUG CMakeFiles/opencv_test_cudev.dir/test_main.cpp.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_lut.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cvt.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_arithm_op.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_reduction.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_color_cvt.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_split_merge.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_pyramids.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_deriv.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_arithm_func.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_integral.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_transpose.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cmp_op.cu.o -o ../../../bin/opencv_test_cudev -L/usr/local/cuda/lib64 -rdynamic -lcudart ../../../lib/libopencv_ts.a ../../../lib/libopencv_highgui.so.3.1.0 -ldl -lm -lpthread -lrt ../../../../3rdparty/ippicv/unpack/ippicv_lnx/lib/intel64/libippicv.a -lcudart -lnppc -lnppi -lnpps -lcufft -L/usr/local/cuda/lib64 -lcudart ../../../lib/libopencv_videoio.so.3.1.0 ../../../lib/libopencv_imgcodecs.so.3.1.0 ../../../lib/libopencv_imgproc.so.3.1.0 ../../../lib/libopencv_core.so.3.1.0 ../../../lib/libopencv_cudev.so.3.1.0 -lnppc -lnppi -lnpps -lcufft -Wl,-rpath,/usr/local/cuda/lib64:/home/rob/Libraries/OpenCV3/opencv-3.1.0/build/lib
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_lut.cu.o: In function `testing::internal::TypeParameterizedTest<LutTest, testing::internal::TemplateSel<LutTest_GpuMat_Test>, testing::internal::Types1<unsigned char> >::Register(char const*, char const*, char const*, int)':
tmpxft_00006387_00000000-10_test_lut.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7LutTestNS0_11TemplateSelI19LutTest_GpuMat_TestEENS0_6Types1IhEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7LutTestNS0_11TemplateSelI19LutTest_GpuMat_TestEENS0_6Types1IhEEE8RegisterEPKcSA_SA_i]+0x14b): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cvt.cu.o: In function `testing::internal::TypeParameterizedTest<CvtTest, testing::internal::TemplateSel<CvtTest_GpuMat_Test>, testing::internal::Types2<int, float> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types2IifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types2IifEEE8RegisterEPKcSA_SA_i]+0x141): undefined reference to `testing::Message::GetString() const'
tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types2IifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types2IifEEE8RegisterEPKcSA_SA_i]+0x452): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cvt.cu.o: In function `testing::internal::TypeParameterizedTest<CvtTest, testing::internal::TemplateSel<CvtTest_GpuMat_Test>, testing::internal::Types4<unsigned short, short, int, float> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types4ItsifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types4ItsifEEE8RegisterEPKcSA_SA_i]+0x152): undefined reference to `testing::Message::GetString() const'
tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types4ItsifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types4ItsifEEE8RegisterEPKcSA_SA_i]+0x472): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cvt.cu.o:tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types5IhtsifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types5IhtsifEEE8RegisterEPKcSA_SA_i]+0x140): more undefined references to `testing::Message::GetString() const' follow
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_reduction.cu.o: In function `testing::AssertionResult testing::internal::CmpHelperFloatingPointEQ<float>(char const*, char const*, float, float)':
tmpxft_000063c4_00000000-10_test_reduction.compute_20.cudafe1.cpp:(.text._ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_[_ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_]+0x12a): undefined reference to `testing::internal::StringStreamToString(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >*)'
tmpxft_000063c4_00000000-10_test_reduction.compute_20.cudafe1.cpp:(.text._ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_[_ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_]+0x139): undefined reference to `testing::internal::StringStreamToString(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >*)'
tmpxft_000063c4_00000000-10_test_reduction.compute_20.cudafe1.cpp:(.text._ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_[_ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_]+0x154): undefined reference to `testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult testing::internal::CmpHelperEQ<int, int>(char const*, char const*, int const&, int const&)':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x5c): undefined reference to `testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char [12]>(char const (&) [12])':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsIA12_cEERS0_RKT_[_ZN7testing15AssertionResultlsIA12_cEERS0_RKT_]+0x66): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char const*>(char const* const&)':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsIPKcEERS0_RKT_[_ZN7testing15AssertionResultlsIPKcEERS0_RKT_]+0x67): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char [7]>(char const (&) [7])':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsIA7_cEERS0_RKT_[_ZN7testing15AssertionResultlsIA7_cEERS0_RKT_]+0x66): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <std::string>(std::string const&)':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsISsEERS0_RKT_[_ZN7testing15AssertionResultlsISsEERS0_RKT_]+0x54): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char [5]>(char const (&) [5])':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsIA5_cEERS0_RKT_[_ZN7testing15AssertionResultlsIA5_cEERS0_RKT_]+0x66): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult testing::internal::CmpHelperEQ<cv::Size_<int>, cv::Size_<int> >(char const*, char const*, cv::Size_<int> const&, cv::Size_<int> const&)':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing8internal11CmpHelperEQIN2cv5Size_IiEES4_EENS_15AssertionResultEPKcS7_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIN2cv5Size_IiEES4_EENS_15AssertionResultEPKcS7_RKT_RKT0_]+0x5c): undefined reference to `testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<LShiftTest, testing::internal::TemplateSel<LShiftTest_Accuracy_Test>, testing::internal::Types1<int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10LShiftTestNS0_11TemplateSelI24LShiftTest_Accuracy_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10LShiftTestNS0_11TemplateSelI24LShiftTest_Accuracy_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i]+0xdc): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<BitNotTest, testing::internal::TemplateSel<BitNotTest_GpuMat_Test>, testing::internal::Types1<int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i]+0x14b): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<BitNotTest, testing::internal::TemplateSel<BitNotTest_GpuMat_Test>, testing::internal::Types2<short, int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types2IsiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types2IsiEEE8RegisterEPKcSA_SA_i]+0x140): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<BitNotTest, testing::internal::TemplateSel<BitNotTest_GpuMat_Test>, testing::internal::Types3<unsigned short, short, int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types3ItsiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types3ItsiEEE8RegisterEPKcSA_SA_i]+0x140): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<BitNotTest, testing::internal::TemplateSel<BitNotTest_GpuMat_Test>, testing::internal::Types4<unsigned char, unsigned short, short, int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types4IhtsiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types4IhtsiEEE8RegisterEPKcSA_SA_i]+0x140): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o:tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitAndTestNS0_11TemplateSelI29BitAndTest_GpuMat_GpuMat_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitAndTestNS0_11TemplateSelI29BitAndTest_GpuMat_GpuMat_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i]+0x14b): more undefined references to `testing::Message::GetString() const' follow
collect2: error: ld returned 1 exit status
modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/build.make:5441: recipe for target 'bin/opencv_test_cudev' failed
make[2]: *** [bin/opencv_test_cudev] Error 1
make[2]: Leaving directory '/home/rob/Libraries/OpenCV3/opencv-3.1.0/build'
CMakeFiles/Makefile2:1834: recipe for target 'modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/all' failed
make[1]: *** [modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/all] Error 2
make[1]: Leaving directory '/home/rob/Libraries/OpenCV3/opencv-3.1.0/build'
Makefile:146: recipe for target 'all' failed
make: *** [all] Error 2
It seems it's in a testing module.
Using CUDA 7.5, GCC-5.2.1 for OpenCV and GCC-4.7 For CUDA specific parts (you've always needed to use two different compilers)
Does anyone a fix or just a way to disable the module since it's only testing?

I had the same problem. I subsequently disabled compiling the testing modules with the cmake option "-DBUILD_TESTS=OFF". Then the opencv build seems to proceed without a problem.
Hope this helps.

Related

trying to compile static libmysqlcppconn8-static.a on Ubuntu 18.04.6 LTS

After looking ant trying all links on the web i just can't figure what is wrong.
g++ version :
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
This is my compilation line :
/usr/bin/g++ -fdiagnostics-color=always -Wall -std=c++11 -DSTATIC_CONCPP -I/home/vagrant/cpp/mysql-connector-cpp/include/ -I/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/ -I/home/vagrant/cpp/mysql-connector-cpp/common/ -I/home/vagrant/cpp/boost/ -I/home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf -g /home/vagrant/cpp/mysql_conn_app/main.cpp /home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a -lssl -lcrypto -lpthread -lresolv -o /home/vagrant/cpp/mysql_conn_app/main.exe
This is the error:
/tmp/ccUnnhKN.o: In function `mysqlx::abi2::r0::string::traits<char>::from_str(mysqlx::abi2::r0::string&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/devapi/common.h:220: undefined reference to `mysqlx::abi2::r0::string::Impl::from_utf8(mysqlx::abi2::r0::string&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/ccUnnhKN.o: In function `mysqlx::abi2::r0::string::traits<char>::to_str[abi:cxx11](mysqlx::abi2::r0::string const&)':
/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/devapi/common.h:225: undefined reference to `mysqlx::abi2::r0::string::Impl::to_utf8[abi:cxx11](mysqlx::abi2::r0::string const&)'
/tmp/ccUnnhKN.o: In function `mysqlx::abi2::r0::SessionSettings::SessionSettings(mysqlx::abi2::r0::string const&)':
/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/devapi/settings.h:526: undefined reference to `mysqlx::abi2::r0::common::Settings_impl::set_from_uri(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::log_handler_init()':
./build/cdk/protocol/mysqlx/./cdk/protocol/mysqlx/protocol.cc:131: undefined reference to `google::protobuf::SetLogHandler(void (*)(google::protobuf::LogLevel, char const*, int, std::string const&))'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Ok(cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:947: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Error(unsigned short, cdk::foundation::string
....
what is wrong here ?
also when adding "-D_GLIBCXX_USE_CXX11_ABI=0" as suggested here:
still not working
/usr/bin/g++ -fdiagnostics-color=always -Wall -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -DSTATIC_CONCPP -I/home/vagrant/cpp/mysql-connector-cpp/include/ -I/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/ -I/home/vagrant/cpp/mysql-connector-cpp/common/ -I/home/vagrant/cpp/boost/ -I/home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf -g /home/vagrant/cpp/mysql_conn_app/main.cpp /home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a -lssl -lcrypto -lpthread -lresolv -o /home/vagrant/cpp/mysql_conn_app/main.exe
gives :
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::log_handler_init()':
./build/cdk/protocol/mysqlx/./cdk/protocol/mysqlx/protocol.cc:131: undefined reference to `google::protobuf::SetLogHandler(void (*)(google::protobuf::LogLevel, char const*, int, std::string const&))'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Ok(cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:947: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Error(unsigned short, cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:1146: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Expr_builder_base::set_call(cdk::protocol::mysqlx::api::Db_obj const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2562: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
adding protobuf + -D_GLIBCXX_USE_CXX11_ABI=0 same error:
/usr/bin/g++ -fdiagnostics-color=always -Wall -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -DSTATIC_CONCPP -I/home/vagrant/cpp/mysql-connector-cpp/include/ -I/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/ -I/home/vagrant/cpp/mysql-connector-cpp/common/ -I/home/vagrant/cpp/boost/ -I/home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf -g /home/vagrant/cpp/mysql_conn_app/main.cpp /home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a /home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf/protobuf-3.19.4/cmake/libprotobufd.a /home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf/protobuf-3.19.4/cmake/libprotobuf-lited.a /home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf/protobuf-3.19.4/cmake/libprotocd.a -lssl -lcrypto -lpthread -lresolv -o /home/vagrant/cpp/mysql_conn_app/main.exe
gives :
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::log_handler_init()':
./build/cdk/protocol/mysqlx/./cdk/protocol/mysqlx/protocol.cc:131: undefined reference to `google::protobuf::SetLogHandler(void (*)(google::protobuf::LogLevel, char const*, int, std::string const&))'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Ok(cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:947: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Error(unsigned short, cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:1146: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Expr_builder_base::set_call(cdk::protocol::mysqlx::api::Db_obj const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2562: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2631: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Expr_builder_base::var(cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2013: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o):./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2874: more undefined references to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)' follow
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `void google::protobuf::internal::ArenaStringPtr::Set<google::protobuf::internal::ArenaStringPtr::EmptyDefault>(google::protobuf::internal::ArenaStringPtr::EmptyDefault, char const*, google::protobuf::Arena*)':
./build/cdk/protocol/mysqlx/./cdk/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring.h:200: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string const&, google::protobuf::Arena*)'

make file error, should I specify a directory somewhere?

My MakeFile
PC++ = mpicxx
CFLAGS = -O3 -D_MPI
LIBS = -llapack -lblas -lgsl -lgslcblas
CFLAGS = $(PFLAGS) $(Fmpi_define) $(GSLINC) -D_TIME #-DAS -D_TIME #-fast -xAVX # -D_TIME #-D_LOGGING #-DAS
LIBS = $(PLIBS)
GHEADERS = assert.h complex.h random.h sblas.h sfunction.h smesh.h sutil.h zeroin.h
QHEADERS = common.h inout.h intervals.h local.h matrixm.h mpi.h bcast.h number.h operators.h state.h stateim.h segment.h svdfunc.h tanmesh.h
ctqmc : ctqmc.o SMatrix1.o
$(PC++) $(CFLAGS) -o $# ctqmc.o SMatrix1.o $(LIBS)
all : ctqmc ctqmcf
ctqmcf : ctqmcf.o SMatrix1.o
$(PC++) $(CFLAGS) -o $# ctqmcf.o SMatrix1.o $(LIBS)
ctqmcf.o : ctqmc.cc
$(PC++) $(CFLAGS) -DAS -c -o ctqmcf.o $<
SMatrix1.o : SMatrix1.cc sfunction.h
$(PC++) -c $(CFLAGS) SMatrix1.cc
ctqmc.o : ctqmc.cc $(GHEADERS) $(QHEADERS)
$(PC++) $(CFLAGS) -c ctqmc.cc
clean :
rm -f ctqmc.o ctqmcf.o ctqmcf ctqmc SMatrix1.o
.SUFFIXES : .cc
.cc.o:
$(PC++) $(CFLAGS) -c $<
.SUFFIXES : .f
.f.o:
$(F77) $(FFLAGS) -c $<
returns this error when make is launched:
mpicxx -D_TIME -c ctqmc.cc
In file included from ctqmc.cc:41:
intervals.h: In member function ‘const funProxy<dcomplex>& nIntervals::exp_direct(int, int) const’:
intervals.h:58:97: warning: no return statement in function returning non-void [-Wreturn-type]
58 | const funProxy<dcomplex>& exp_direct(int type, int i) const {cerr<<"Should not happen"<<endl; }//return NULL;}
| ^
mpicxx -c -D_TIME SMatrix1.cc
mpicxx -D_TIME -o ctqmc ctqmc.o SMatrix1.o
/usr/bin/ld: ctqmc.o: warning: relocation against `gsl_multiroot_fsolver_hybrids' in read-only section `.text._ZN8FindRootC2EmPFiPK10gsl_vectorPvP
S0_EPdS3_[_ZN8FindRootC5EmPFiPK10gsl_vectorPvPS0_EPdS3_]'
/usr/bin/ld: ctqmc.o: in function `tanmesh_f(gsl_vector const*, void*, gsl_vector*)':
ctqmc.cc:(.text+0x3ed3): undefined reference to `gsl_vector_get'
/usr/bin/ld: ctqmc.cc:(.text+0x3eed): undefined reference to `gsl_vector_get'
/usr/bin/ld: ctqmc.cc:(.text+0x3f31): undefined reference to `gsl_vector_set'
/usr/bin/ld: ctqmc.cc:(.text+0x3fa2): undefined reference to `gsl_vector_set'
/usr/bin/ld: ctqmc.o: in function `xptsv_(int const*, int const*, double*, double*, double*, int const*, int*)':
ctqmc.cc:(.text._Z6xptsv_PKiS0_PdS1_S1_S0_Pi[_Z6xptsv_PKiS0_PdS1_S1_S0_Pi]+0x4d): undefined reference to `dptsv_'
/usr/bin/ld: ctqmc.o: in function `xptsv_(int const*, int const*, double*, dcomplex*, dcomplex*, int const*, int*)':
ctqmc.cc:(.text._Z6xptsv_PKiS0_PdP8dcomplexS3_S0_Pi[_Z6xptsv_PKiS0_PdP8dcomplexS3_S0_Pi]+0x4d): undefined reference to `zptsv_'
/usr/bin/ld: ctqmc.o: in function `xgemm(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::bas
ic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, double, double const*, int, double const*, int, double, doub
le*, int)':
ctqmc.cc:(.text._Z5xgemmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iiidPKdiS8_idPdi[_Z5xgemmRKNSt7__cxx1112basic_stringIcSt11char_tr
aitsIcESaIcEEES6_iiidPKdiS8_idPdi]+0x8c): undefined reference to `dgemm_'
/usr/bin/ld: ctqmc.o: in function `xgemm(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::bas
ic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, dcomplex const&, dcomplex const*, int, dcomplex const*, int,
dcomplex const&, dcomplex*, int)':
ctqmc.cc:(.text._Z5xgemmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iiiRK8dcomplexPS8_iSA_iS9_PS7_i[_Z5xgemmRKNSt7__cxx1112basic_stri
ngIcSt11char_traitsIcESaIcEEES6_iiiRK8dcomplexPS8_iSA_iS9_PS7_i]+0x80): undefined reference to `zgemm_'
/usr/bin/ld: ctqmc.o: in function `xgetrf(int, double*, int, int*)':
ctqmc.cc:(.text._Z6xgetrfiPdiPi[_Z6xgetrfiPdiPi]+0x52): undefined reference to `dgetrf_'
/usr/bin/ld: ctqmc.o: in function `xgetrf(int, dcomplex*, int, int*)':
ctqmc.cc:(.text._Z6xgetrfiP8dcomplexiPi[_Z6xgetrfiP8dcomplexiPi]+0x52): undefined reference to `zgetrf_'
/usr/bin/ld: ctqmc.o: in function `xgetrs(int, int, double*, int, int*, double*, int)':
ctqmc.cc:(.text._Z6xgetrsiiPdiPiS_i[_Z6xgetrsiiPdiPiS_i]+0x70): undefined reference to `dgetrs_'
/usr/bin/ld: ctqmc.o: in function `xgetrs(int, int, dcomplex*, int, int*, dcomplex*, int)':
ctqmc.cc:(.text._Z6xgetrsiiP8dcomplexiPiS0_i[_Z6xgetrsiiP8dcomplexiPiS0_i]+0x70): undefined reference to `zgetrs_'
/usr/bin/ld: ctqmc.o: in function `xsyev(int, double*, int, double*, double*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::a
llocator<char> >)':
ctqmc.cc:(.text._Z5xsyeviPdiS_S_iNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_Z5xsyeviPdiS_S_iNSt7__cxx1112basic_stringIcSt11char_traitsI
cESaIcEEE]+0x87): undefined reference to `dsyev_'
/usr/bin/ld: ctqmc.o: in function `xgesdd(bool, int, int, double*, int, double*, double*, int, double*, int, double*, int, double*, int*)':
ctqmc.cc:(.text._Z6xgesddbiiPdiS_S_iS_iS_iS_Pi[_Z6xgesddbiiPdiS_S_iS_iS_iS_Pi]+0xfc): undefined reference to `dgesdd_'
/usr/bin/ld: ctqmc.o: in function `xgemv(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, double,
double const*, int, double const*, double, double*)':
ctqmc.cc:(.text._Z5xgemvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiidPKdiS8_dPd[_Z5xgemvRKNSt7__cxx1112basic_stringIcSt11char_traitsIc
ESaIcEEEiidPKdiS8_dPd]+0x12e): undefined reference to `dgemv_'
/usr/bin/ld: ctqmc.o: in function `dger(double*, double, functionb<double> const&, functionb<double> const&)':
ctqmc.cc:(.text._Z4dgerPddRK9functionbIdES3_[_Z4dgerPddRK9functionbIdES3_]+0xa1): undefined reference to `dger_'
/usr/bin/ld: ctqmc.o: in function `RanGSL::RanGSL(int)':
ctqmc.cc:(.text._ZN6RanGSLC2Ei[_ZN6RanGSLC5Ei]+0x14): undefined reference to `gsl_rng_env_setup'
/usr/bin/ld: ctqmc.cc:(.text._ZN6RanGSLC2Ei[_ZN6RanGSLC5Ei]+0x1b): undefined reference to `gsl_rng_ranlux389'
/usr/bin/ld: ctqmc.cc:(.text._ZN6RanGSLC2Ei[_ZN6RanGSLC5Ei]+0x31): undefined reference to `gsl_rng_alloc'
/usr/bin/ld: ctqmc.cc:(.text._ZN6RanGSLC2Ei[_ZN6RanGSLC5Ei]+0x52): undefined reference to `gsl_rng_set'
/usr/bin/ld: ctqmc.o: in function `RanGSL::operator()()':
ctqmc.cc:(.text._ZN6RanGSLclEv[_ZN6RanGSLclEv]+0x1c): undefined reference to `gsl_rng_uniform'
/usr/bin/ld: ctqmc.o: in function `RanGSL::~RanGSL()':
ctqmc.cc:(.text._ZN6RanGSLD2Ev[_ZN6RanGSLD5Ev]+0x1c): undefined reference to `gsl_rng_free'
/usr/bin/ld: ctqmc.o: in function `FindRoot::FindRoot(unsigned long, int (*)(gsl_vector const*, void*, gsl_vector*), double*, void*)':
ctqmc.cc:(.text._ZN8FindRootC2EmPFiPK10gsl_vectorPvPS0_EPdS3_[_ZN8FindRootC5EmPFiPK10gsl_vectorPvPS0_EPdS3_]+0x44): undefined reference to `gsl_ve
ctor_alloc'
/usr/bin/ld: ctqmc.cc:(.text._ZN8FindRootC2EmPFiPK10gsl_vectorPvPS0_EPdS3_[_ZN8FindRootC5EmPFiPK10gsl_vectorPvPS0_EPdS3_]+0xb6): undefined referen
ce to `gsl_vector_set'
/usr/bin/ld: ctqmc.cc:(.text._ZN8FindRootC2EmPFiPK10gsl_vectorPvPS0_EPdS3_[_ZN8FindRootC5EmPFiPK10gsl_vectorPvPS0_EPdS3_]+0xd4): undefined referen
ce to `gsl_multiroot_fsolver_hybrids'
/usr/bin/ld: ctqmc.cc:(.text._ZN8FindRootC2EmPFiPK10gsl_vectorPvPS0_EPdS3_[_ZN8FindRootC5EmPFiPK10gsl_vectorPvPS0_EPdS3_]+0xef): undefined referen
ce to `gsl_multiroot_fsolver_alloc'
/usr/bin/ld: ctqmc.cc:(.text._ZN8FindRootC2EmPFiPK10gsl_vectorPvPS0_EPdS3_[_ZN8FindRootC5EmPFiPK10gsl_vectorPvPS0_EPdS3_]+0x11a): undefined refere
nce to `gsl_multiroot_fsolver_set'
/usr/bin/ld: ctqmc.o: in function `FindRoot::call()':
ctqmc.cc:(.text._ZN8FindRoot4callEv[_ZN8FindRoot4callEv]+0x3d): undefined reference to `gsl_multiroot_fsolver_iterate'
/usr/bin/ld: ctqmc.cc:(.text._ZN8FindRoot4callEv[_ZN8FindRoot4callEv]+0x66): undefined reference to `gsl_multiroot_test_residual'
/usr/bin/ld: ctqmc.cc:(.text._ZN8FindRoot4callEv[_ZN8FindRoot4callEv]+0xd5): undefined reference to `gsl_vector_get'
/usr/bin/ld: ctqmc.o: in function `FindRoot::~FindRoot()':
ctqmc.cc:(.text._ZN8FindRootD2Ev[_ZN8FindRootD5Ev]+0x1c): undefined reference to `gsl_multiroot_fsolver_free'
/usr/bin/ld: ctqmc.cc:(.text._ZN8FindRootD2Ev[_ZN8FindRootD5Ev]+0x2c): undefined reference to `gsl_vector_free'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:23: ctqmc] Error 1
I'm not an expert in using make, so I don't understand what I'm doing wrong
halp

Xalan link failure using libraries built from source

I am upgrading one of our libraries to the latest version. The xalan from GitHub at https://github.com/apache/xalan-c. I was able to compile this library successfully using gcc 12. And when I ran make test command, it was all OK. But when used it in my code and it will fail when try to link, I got errors like this (I did check the library search path, both libxalan-c.so and libxalanMsg.so can be found by the ld):
g++ -g -O0 -Werror -Wunused -Wall -D__USE_XOPEN2K8 -D_REENTRANT -D__STL_PTHREADS -std=c++17 -pthread -Wno-parentheses -Wno-nonnull -pipe -lxerces-c -L/rapid/rapid_workspaces/chuhuan/GitHub/xalan-c/build/lib64/ -lxalan-c -lxalanMsg -Lxxxxxxxxx/TargetRTS/ -ldhf
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: linux/TargetRTS/ParamConfig.o: in function `dhf::DataHandlerFactory::initializeXMLLibs()':
xxxxxxxxx/DataHandlerFactory.hh:58: undefined reference to `xalanc_1_12::XalanTransformer::initialize(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DataHandlerFactory.hh:59: undefined reference to `xalanc_1_12::XPathEvaluator::initialize(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/TargetRTS//libdhf.a(DOMImpl.o): in function `dhf::DOMImpl::transform(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
xxxxxxxxx/DOMImpl.cc:173: undefined reference to `xalanc_1_12::XercesParserLiaison::XercesParserLiaison(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:183: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(char16_t const*, xercesc_4_0::MemoryManager&, unsigned long)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:184: undefined reference to `xalanc_1_12::XercesDOMWrapperParsedSource::XercesDOMWrapperParsedSource(xercesc_4_0::DOMDocument const*, xalanc_1_12::XercesParserLiaison&, xalanc_1_12::XercesDOMSupport&, xalanc_1_12::XalanDOMString const&, xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:190: undefined reference to `xalanc_1_12::FormatterToXercesDOM::FormatterToXercesDOM(xercesc_4_0::DOMDocument*, xercesc_4_0::DOMElement*, xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:191: undefined reference to `xalanc_1_12::XalanTransformer::XalanTransformer(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:192: undefined reference to `xalanc_1_12::XSLTResultTarget::XSLTResultTarget(xalanc_1_12::FormatterListener&, xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:192: undefined reference to `xalanc_1_12::XSLTInputSource::XSLTInputSource(char const*, xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/TargetRTS//libdhf.a(DOMImpl.o): in function `dhf::DOMImpl::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double*)':
xxxxxxxxx/DOMImpl.cc:237: undefined reference to `xalanc_1_12::XercesParserLiaison::XercesParserLiaison(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:244: undefined reference to `xalanc_1_12::XercesParserLiaison::createDocument(xercesc_4_0::DOMDocument const*, bool, bool, bool)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:246: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(char const*, xercesc_4_0::MemoryManager&, unsigned long)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:248: undefined reference to `xalanc_1_12::XPathEvaluator::XPathEvaluator(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:250: undefined reference to `xalanc_1_12::XPathEvaluator::evaluate(xalanc_1_12::DOMSupport&, xalanc_1_12::XalanNode*, char16_t const*, xalanc_1_12::XalanElement const*)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/TargetRTS//libdhf.a(DOMImpl.o): in function `dhf::DOMImpl::getSize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int*)':
xxxxxxxxx/DOMImpl.cc:298: undefined reference to `xalanc_1_12::XercesParserLiaison::XercesParserLiaison(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:305: undefined reference to `xalanc_1_12::XercesParserLiaison::createDocument(xercesc_4_0::DOMDocument const*, bool, bool, bool)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:307: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(char const*, xercesc_4_0::MemoryManager&, unsigned long)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:309: undefined reference to `xalanc_1_12::XPathEvaluator::XPathEvaluator(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:313: undefined reference to `xalanc_1_12::XPathEvaluator::selectSingleNode(xalanc_1_12::DOMSupport&, xalanc_1_12::XalanNode*, char16_t const*, xalanc_1_12::XalanElement const*)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/TargetRTS//libdhf.a(DOMImpl.o): in function `dhf::DOMImpl::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
xxxxxxxxx/DOMImpl.cc:364: undefined reference to `xalanc_1_12::XercesParserLiaison::XercesParserLiaison(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:371: undefined reference to `xalanc_1_12::XercesParserLiaison::createDocument(xercesc_4_0::DOMDocument const*, bool, bool, bool)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:373: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(char const*, xercesc_4_0::MemoryManager&, unsigned long)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:375: undefined reference to `xalanc_1_12::XPathEvaluator::XPathEvaluator(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:377: undefined reference to `xalanc_1_12::XPathEvaluator::evaluate(xalanc_1_12::DOMSupport&, xalanc_1_12::XalanNode*, char16_t const*, xalanc_1_12::XalanElement const*)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/TargetRTS//libdhf.a(DOMImpl.o): in function `dhf::DOMImpl::serialize(std::ostream&)':
xxxxxxxxx/DOMImpl.cc:486: undefined reference to `xalanc_1_12::XalanStdOutputStream::XalanStdOutputStream(std::ostream&, xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:490: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:490: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:490: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:490: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:490: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/TargetRTS//libdhf.a(DOMImpl.o):xxxxxxxxx/DOMImpl.cc:490: more undefined references to `xalanc_1_12::XalanDOMString::XalanDOMString(xercesc_4_0::MemoryManager&)' follow
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/TargetRTS//libdhf.a(DOMImpl.o): in function `dhf::DOMImpl::serialize(std::ostream&)':
xxxxxxxxx/DOMImpl.cc:490: undefined reference to `xalanc_1_12::FormatterToXML::FormatterToXML(xalanc_1_12::Writer&, xalanc_1_12::XalanDOMString const&, bool, int, xalanc_1_12::XalanDOMString const&, xalanc_1_12::XalanDOMString const&, xalanc_1_12::XalanDOMString const&, xalanc_1_12::XalanDOMString const&, bool, xalanc_1_12::XalanDOMString const&, xalanc_1_12::FormatterListener::eFormat, bool, xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:501: undefined reference to `xalanc_1_12::XercesDOMWalker::traverse(xercesc_4_0::DOMNode*)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/TargetRTS//libdhf.a(DOMImpl.o): in function `dhf::DOMImpl::selectNode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
xxxxxxxxx/DOMImpl.cc:510: undefined reference to `xalanc_1_12::XercesParserLiaison::XercesParserLiaison(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:517: undefined reference to `xalanc_1_12::XercesParserLiaison::createDocument(xercesc_4_0::DOMDocument const*, bool, bool, bool)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:522: undefined reference to `xalanc_1_12::XalanDOMString::XalanDOMString(char const*, xercesc_4_0::MemoryManager&, unsigned long)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:527: undefined reference to `xalanc_1_12::XPathEvaluator::XPathEvaluator(xercesc_4_0::MemoryManager&)'
xxxxxxxxxgcc-12.2.0/../binutils-2.36.1/bin/ld: xxxxxxxxx/DOMImpl.cc:528: undefined reference to `xalanc_1_12::XPathEvaluator::selectSingleNode(xalanc_1_12::DOMSupport&, xalanc_1_12::XalanNode*, char16_t const*, xalanc_1_12::XalanElement const*)'
collect2: error: ld returned 1 exit status
my cmake options:
CC=gcc-12.2.0/bin/gcc CXX=gcc-12.2.0/bin/g++ CFLAGS=-O3 CXXFLAGS=-O3 cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=xalan-c/build -DCMAKE_BUILD_TYPE=Release -Dmessage-loader=inmemory -Dtranscoder=default xalan-c
It seems something may be inconsistent with my build options, any idea to fix this?
Thanks very much!
Chunde
Eventually figured out the issue, this was because Xalan need to link to Xercesc, without specifying the path to the version 4.0.0 of Xercesc, it will link to the default version at system path. So I used
-DCMAKE_PREFIX_PATH
variable to set that, the new cmake command looks like this:
CC=gcc-12.2.0/bin/gcc CXX=gcc-12.2.0/bin/g++ CFLAGS=-O3 CXXFLAGS=-O3 cmake -DCMAKE_PREFIX_PATH=xxx/xerces-c_4.0.0/ -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=xalan-c/build -DCMAKE_BUILD_TYPE=Release -Dmessage-loader=inmemory -Dtranscoder=default xalan-c

/usr/bin/ld: cannot find -lprotobuf

I am new to linux and c++. I am trying to run veins gym on Ubuntu-18.04. When I run snakemake -jall (see the link) I receive an error:
make: Entering directory '/home/rost/serpentine-env/src'
Creating executable: out/gcc-debug//experiment_dbg
/usr/bin/ld: cannot find -lprotobuf
collect2: error: ld returned 1 exit status
Makefile:96: recipe for target 'out/gcc-debug//experiment_dbg' failed
make: *** [out/gcc-debug//experiment_dbg] Error 1
make: Leaving directory '/home/rost/serpentine-env/src'
[Thu Dec 30 12:34:46 2021]
Error in rule build:
jobid: 1
output: src/experiment_dbg
shell:
make -j8 -C src MODE=debug
(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /home/rost/serpentine-env/.snakemake/log/2021-12-30T123446.742985.snakemake.log
To obtain a little more information, I run (source)
ld -lprotobuf --verbose
and I get
attempt to open //usr/local/lib/x86_64-linux-gnu/libprotobuf.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libprotobuf.a failed
attempt to open //lib/x86_64-linux-gnu/libprotobuf.so failed
attempt to open //lib/x86_64-linux-gnu/libprotobuf.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libprotobuf.so failed
attempt to open //usr/lib/x86_64-linux-gnu/libprotobuf.a failed
attempt to open //usr/lib/x86_64-linux-gnu64/libprotobuf.so failed
attempt to open //usr/lib/x86_64-linux-gnu64/libprotobuf.a failed
attempt to open //usr/local/lib64/libprotobuf.so failed
attempt to open //usr/local/lib64/libprotobuf.a failed
attempt to open //lib64/libprotobuf.so failed
attempt to open //lib64/libprotobuf.a failed
attempt to open //usr/lib64/libprotobuf.so failed
attempt to open //usr/lib64/libprotobuf.a failed
attempt to open //usr/local/lib/libprotobuf.so failed
attempt to open //usr/local/lib/libprotobuf.a failed
attempt to open //lib/libprotobuf.so failed
attempt to open //lib/libprotobuf.a failed
attempt to open //usr/lib/libprotobuf.so failed
attempt to open //usr/lib/libprotobuf.a failed
attempt to open //usr/x86_64-linux-gnu/lib64/libprotobuf.so failed
attempt to open //usr/x86_64-linux-gnu/lib64/libprotobuf.a failed
attempt to open //usr/x86_64-linux-gnu/lib/libprotobuf.so failed
attempt to open //usr/x86_64-linux-gnu/lib/libprotobuf.a failed
ld: cannot find -lprotobuf
I guess, I would have to make symlink manually, but I do not find any .so files in the archives from protobuf. Or maybe my interpretation is wrong. If some information is missing - I will provide.
Thank you!
UPDATE:
after runningsudo apt install libprotobuf-dev, command snakemake -jall produces
make: Entering directory '/home/rost/serpentine-env/src'
Creating executable: out/gcc-debug//experiment_dbg
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Request::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:563: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:571: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:579: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:593: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Request::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:644: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Request::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:690: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Request::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:757: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Reply::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:946: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:954: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:962: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:976: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Reply::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1027: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Reply::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1073: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Reply::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1140: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::Init(veinsgym::proto::Init const&)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1166: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1174: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1182: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::Clear()':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1233: undefined reference to `google::protobuf::internal::ArenaStringPtr::ClearToEmpty()'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1234: undefined reference to `google::protobuf::internal::ArenaStringPtr::ClearToEmpty()'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1235: undefined reference to `google::protobuf::internal::ArenaStringPtr::ClearToEmpty()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1249: undefined reference to `google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const*, google::protobuf::internal::ParseContext*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1259: undefined reference to `google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const*, google::protobuf::internal::ParseContext*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1269: undefined reference to `google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const*, google::protobuf::internal::ParseContext*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1284: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1335: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1371: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::MergeFrom(veinsgym::proto::Init const&)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.h:2983: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.h:3034: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.h:3085: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1441: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Shutdown::Shutdown(veinsgym::proto::Shutdown const&)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1456: undefined reference to `google::protobuf::internal::ZeroFieldsBase::~ZeroFieldsBase()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Shutdown::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1480: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Step::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1580: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1588: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1602: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Step::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1639: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Step::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1668: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Step::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1724: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1992: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2000: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2008: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2016: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2024: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
out/gcc-debug//protobuf/veinsgym.pb.o:/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2032: more undefined references to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)' follow
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2046: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2115: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2177: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2252: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::Box(google::protobuf::Arena*, bool)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2264: undefined reference to `google::protobuf::RepeatedField<double>::RepeatedField(google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2264: undefined reference to `google::protobuf::RepeatedField<double>::~RepeatedField()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::Box(veinsgym::proto::Box const&)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2273: undefined reference to `google::protobuf::RepeatedField<double>::RepeatedField(google::protobuf::RepeatedField<double> const&)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2273: undefined reference to `google::protobuf::RepeatedField<double>::~RepeatedField()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::~Box()':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2281: undefined reference to `google::protobuf::RepeatedField<double>::~RepeatedField()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::Clear()':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2308: undefined reference to `google::protobuf::RepeatedField<double>::Clear()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2321: undefined reference to `google::protobuf::internal::PackedDoubleParser(void*, char const*, google::protobuf::internal::ParseContext*)'
...
/home/rost/serpentine-env/src/./protobuf/veinsgym.pb.h:780: undefined reference to `google::protobuf::internal::ZeroFieldsBase::InternalSwap(google::protobuf::internal::ZeroFieldsBase*)'
out/gcc-debug//serpentine/GymSplitter.o: In function `veinsgym::proto::Shutdown::CopyFrom(veinsgym::proto::Shutdown const&)':
/home/rost/serpentine-env/src/./protobuf/veinsgym.pb.h:835: undefined reference to `google::protobuf::internal::ZeroFieldsBase::CopyImpl(google::protobuf::Message*, google::protobuf::Message const&)'
out/gcc-debug//serpentine/GymSplitter.o: In function `veinsgym::proto::Box::set_values(int, double)':
/home/rost/serpentine-env/src/./protobuf/veinsgym.pb.h:3778: undefined reference to `google::protobuf::RepeatedField<double>::Set(int, double const&)'
out/gcc-debug//serpentine/GymSplitter.o: In function `void google::protobuf::RepeatedField<double>::Add<double const*>(double const*, double const*)':
/usr/local/include/google/protobuf/repeated_field.h:705: undefined reference to `google::protobuf::RepeatedField<double>::size() const'
/usr/local/include/google/protobuf/repeated_field.h:712: undefined reference to `google::protobuf::RepeatedField<double>::elements() const'
/usr/local/include/google/protobuf/repeated_field.h:712: undefined reference to `google::protobuf::RepeatedField<double>::size() const'
/usr/local/include/google/protobuf/repeated_field.h:713: undefined reference to `google::protobuf::RepeatedField<double>::size() const'
out/gcc-debug//serpentine/GymSplitter.o: In function `google::protobuf::RepeatedField<double>::FastAdderImpl<0, true>::FastAdderImpl(google::protobuf::RepeatedField<double>*)':
/usr/local/include/google/protobuf/repeated_field.h:448: undefined reference to `google::protobuf::RepeatedField<double>::unsafe_elements() const'
out/gcc-debug//serpentine/GymSplitter.o: In function `google::protobuf::RepeatedField<double>::FastAdderImpl<0, true>::Add(double)':
/usr/local/include/google/protobuf/repeated_field.h:457: undefined reference to `google::protobuf::RepeatedField<double>::unsafe_elements() const'
collect2: error: ld returned 1 exit status
Makefile:96: recipe for target 'out/gcc-debug//experiment_dbg' failed
make: *** [out/gcc-debug//experiment_dbg] Error 1
make: Leaving directory '/home/rost/serpentine-env/src'

Using Crypto++ in Clion IDE

I have some problem with compile correct application in fresh-installed Clion IDE. Earlier I used Code::Blocks and all compiling successfully. Project use pthread and Crypto++ library. I'm already have them installed on my Ubuntu 15.04. And compile Clion project with -pthread flag. But it can't find crypto++ library. How to fix this?
My CMake file:
cmake_minimum_required(VERSION 3.3)
project(Chat)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
set(SOURCE_FILES
include/Chat.h
include/Checker.h
include/Client.h
include/DataTransferingInterface.h
include/EncryptorDES.h
include/EncryptorRSA.h
include/Logger.h
include/OwnerClientInterface.h
include/OwnerServerInterface.h
include/Parser.h
include/SecureChat.h
include/Server.h
src/Chat.cpp
src/Checker.cpp
src/Client.cpp
src/DataTransferingInterface.cpp
src/EncryptorDES.cpp
src/EncryptorRSA.cpp
src/Logger.cpp
src/OwnerClientInterface.cpp
src/OwnerServerInterface.cpp
src/Parser.cpp
src/SecureChat.cpp
src/Server.cpp
main.cpp)
add_executable(Chat ${SOURCE_FILES})
Compile errors:
/usr/include/cryptopp/integer.h:26: undefined reference to `vtable for CryptoPP::Integer'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::AbstractRing<CryptoPP::Integer>::MultiplicativeGroupT::~MultiplicativeGroupT()':
/usr/include/cryptopp/algebra.h:70: undefined reference to `vtable for CryptoPP::AbstractRing<CryptoPP::Integer>::MultiplicativeGroupT'
/usr/include/cryptopp/algebra.h:70: undefined reference to `CryptoPP::AbstractGroup<CryptoPP::Integer>::~AbstractGroup()'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::FileStore::~FileStore()':
/usr/include/cryptopp/files.h:14: undefined reference to `vtable for CryptoPP::FileStore'
/usr/include/cryptopp/files.h:14: undefined reference to `vtable for CryptoPP::FileStore'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::FileSink::~FileSink()':
/usr/include/cryptopp/files.h:77: undefined reference to `vtable for CryptoPP::FileSink'
/usr/include/cryptopp/files.h:77: undefined reference to `vtable for CryptoPP::FileSink'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::HMAC_Base::~HMAC_Base()':
/usr/include/cryptopp/hmac.h:12: undefined reference to `vtable for CryptoPP::HMAC_Base'
/usr/include/cryptopp/hmac.h:12: undefined reference to `vtable for CryptoPP::HMAC_Base'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::AlgorithmParametersTemplate<char const*>::AssignValue(char const*, std::type_info const&, void*) const':
/usr/include/cryptopp/algparam.h:313: undefined reference to `CryptoPP::g_pAssignIntToInteger'
/usr/include/cryptopp/algparam.h:313: undefined reference to `CryptoPP::g_pAssignIntToInteger'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptorBase<CryptoPP::ECPPoint>::Encrypt(CryptoPP::RandomNumberGenerator&, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/integer.h:118: undefined reference to `CryptoPP::Integer::One()'
/usr/include/cryptopp/integer.h:118: undefined reference to `CryptoPP::Integer::Zero()'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptorBase<CryptoPP::ECPPoint>::Encrypt(CryptoPP::RandomNumberGenerator&, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/pubkey.h:1228: undefined reference to `CryptoPP::Integer::One()'
/usr/include/cryptopp/pubkey.h:1228: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::RandomNumberGenerator&, CryptoPP::Integer const&, CryptoPP::Integer const&, CryptoPP::Integer::RandomNumberType, CryptoPP::Integer const&, CryptoPP::Integer const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::Pump2(unsigned long long&, bool)':
/usr/include/cryptopp/filters.h:763: undefined reference to `CryptoPP::DEFAULT_CHANNEL'
/usr/include/cryptopp/filters.h:763: undefined reference to `CryptoPP::FileStore::TransferTo2(CryptoPP::BufferedTransformation&, unsigned long long&, std::string const&, bool)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::PumpMessages2(unsigned int&, bool)':
/usr/include/cryptopp/filters.h:765: undefined reference to `CryptoPP::DEFAULT_CHANNEL'
/usr/include/cryptopp/filters.h:765: undefined reference to `CryptoPP::BufferedTransformation::TransferMessagesTo2(CryptoPP::BufferedTransformation&, unsigned int&, std::string const&, bool)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::PumpAll2(bool)':
/usr/include/cryptopp/filters.h:767: undefined reference to `CryptoPP::DEFAULT_CHANNEL'
/usr/include/cryptopp/filters.h:767: undefined reference to `CryptoPP::BufferedTransformation::TransferAllTo2(CryptoPP::BufferedTransformation&, std::string const&, bool)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::SourceExhausted() const':
/usr/include/cryptopp/filters.h:769: undefined reference to `CryptoPP::BufferedTransformation::AnyRetrievable() const'
/usr/include/cryptopp/filters.h:769: undefined reference to `CryptoPP::BufferedTransformation::AnyMessages() const'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptionAlgorithm_Xor<CryptoPP::HMAC<CryptoPP::SHA1>, false>::SymmetricEncrypt(CryptoPP::RandomNumberGenerator&, unsigned char const*, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/gfpcrypt.h:439: undefined reference to `CryptoPP::xorbuf(unsigned char*, unsigned char const*, unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:441: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:442: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptionAlgorithm_Xor<CryptoPP::HMAC<CryptoPP::SHA1>, false>::SymmetricDecrypt(unsigned char const*, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/gfpcrypt.h:470: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:471: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:481: undefined reference to `CryptoPP::xorbuf(unsigned char*, unsigned char const*, unsigned char const*, unsigned long)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_KeyAgreementAlgorithm_DH<CryptoPP::ECPPoint, CryptoPP::EnumToType<CryptoPP::CofactorMultiplicationOption, 0> >::AgreeWithEphemeralPrivateKey(CryptoPP::DL_GroupParameters<CryptoPP::ECPPoint> const&, CryptoPP::DL_FixedBasePrecomputation<CryptoPP::ECPPoint> const&, CryptoPP::Integer const&) const':
/usr/include/cryptopp/pubkey.h:1445: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::Integer const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_KeyAgreementAlgorithm_DH<CryptoPP::ECPPoint, CryptoPP::EnumToType<CryptoPP::CofactorMultiplicationOption, 0> >::AgreeWithStaticPrivateKey(CryptoPP::DL_GroupParameters<CryptoPP::ECPPoint> const&, CryptoPP::ECPPoint const&, bool, CryptoPP::Integer const&) const':
/usr/include/cryptopp/pubkey.h:1473: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::Integer const&)'
/usr/include/cryptopp/pubkey.h:1473: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::Integer const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::HMAC<CryptoPP::SHA1>::HMAC(unsigned char const*, unsigned long)':
/usr/include/cryptopp/hmac.h:48: undefined reference to `CryptoPP::g_nullNameValuePairs'
/usr/include/cryptopp/hmac.h:48: undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned long, CryptoPP::NameValuePairs const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::P1363_KDF2<CryptoPP::SHA1>::DeriveKey(unsigned char*, unsigned long, unsigned char const*, unsigned long, unsigned char const*, unsigned long)':
/usr/include/cryptopp/pubkey.h:506: undefined reference to `CryptoPP::P1363_MGF1KDF2_Common(CryptoPP::HashTransformation&, unsigned char*, unsigned long, unsigned char const*, unsigned long, unsigned char const*, unsigned long, bool, unsigned int)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::IteratedHashWithStaticTransform<unsigned int, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 64u, 20u, CryptoPP::SHA1, 0u, false>::Init()':
/usr/include/cryptopp/iterhash.h:90: undefined reference to `CryptoPP::SHA1::InitState(unsigned int*)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o:(.rodata._ZTIN8CryptoPP16IteratedHashBaseIjNS_18HashTransformationEEE[_ZTIN8CryptoPP16IteratedHashBaseIjNS_18HashTransformationEEE]+0x10): undefined reference to `typeinfo for CryptoPP::HashTransformation'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o:(.rodata._ZTIN8CryptoPP25SimpleKeyingInterfaceImplINS_9HMAC_BaseENS_4HMACINS_4SHA1EEEEE[_ZTIN8CryptoPP25SimpleKeyingInterfaceImplINS_9HMAC_BaseENS_4HMACINS_4SHA1EEEEE]+0x10): undefined reference to `typeinfo for CryptoPP::HMAC_Base'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::HashTransformation::HashTransformation(CryptoPP::HashTransformation const&)':
/usr/include/cryptopp/cryptlib.h:531: undefined reference to `vtable for CryptoPP::HashTransformation'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::IteratedHashWithStaticTransform<unsigned int, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 64u, 20u, CryptoPP::SHA1, 0u, false>::HashEndianCorrectedBlock(unsigned int const*)':
/usr/include/cryptopp/iterhash.h:89: undefined reference to `CryptoPP::SHA1::Transform(unsigned int*, unsigned int const*)'
collect2: error: ld returned 1 exit status
CMakeFiles/Chat.dir/build.make:406: recipe for target 'Chat' failed
make[2]: *** [Chat] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Chat.dir/all' failed
make[1]: *** [CMakeFiles/Chat.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I performed the following after add_executable in my CMakeLists.txt to resolve the issue:
target_link_libraries(Chat /usr/lib/libcrypto++.a)