Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Compiling error: undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()' #291
Comments
|
You are compiling Ceres with CXX11 enabled, but have not compiled glog with C++11 enabled. |
Yamin05114
commented
Jun 9, 2017
|
@alexsmac Should I compile glog again with CXX11 or just turn off CXX11 of Ceres |
Yamin05114
commented
Jun 9, 2017
|
I solved the problem by rebuild the glog from source file. But new problem came out like the following: |
Yamin05114 commentedJun 9, 2017
Hi I came across this error when compiling, thanks in advance:
[ 54%] Linking CXX executable ../bin/nist CMakeFiles/nist.dir/nist.cc.o: In functionstd::__cxx11::basic_string<char, std::char_traits, std::allocator >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)':nist.cc:(.text._ZN6google17MakeCheckOpStringIiiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x49): undefined reference to
google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()' ../lib/libceres.a(problem_impl.cc.o): In functionstd::__cxx11::basic_string<char, std::char_traits, std::allocator >* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*)':problem_impl.cc:(.text._ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x51): undefined reference to
google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()' ../lib/libceres.a(problem_impl.cc.o): In functionstd::__cxx11::basic_string<char, std::char_traits, std::allocator >* google::MakeCheckOpString<ceres::internal::ParameterBlock*, ceres::internal::ParameterBlock*>(ceres::internal::ParameterBlock* const&, ceres::internal::ParameterBlock* const&, char const*)':problem_impl.cc:(.text._ZN6google17MakeCheckOpStringIPN5ceres8internal14ParameterBlockES4_EEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIPN5ceres8internal14ParameterBlockES4_EEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x51): undefined reference to
google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()' ../lib/libceres.a(triplet_sparse_matrix.cc.o): In functionstd::__cxx11::basic_string<char, std::char_traits, std::allocator >* google::MakeCheckOpString<double, double>(double const&, double const&, char const*)':triplet_sparse_matrix.cc:(.text._ZN6google17MakeCheckOpStringIddEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIddEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x54): undefined reference to
google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()' ../lib/libceres.a(compressed_row_sparse_matrix.cc.o): In functionstd::__cxx11::basic_string<char, std::char_traits, std::allocator >* google::MakeCheckOpString<int, unsigned long>(int const&, unsigned long const&, char const*)':compressed_row_sparse_matrix.cc:(.text._ZN6google17MakeCheckOpStringIimEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIimEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x51): undefined reference to
google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()' ../lib/libceres.a(compressed_row_sparse_matrix.cc.o):compressed_row_sparse_matrix.cc:(.text._ZN6google17MakeCheckOpStringImiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x50): more undefined references togoogle::base::CheckOpMessageBuilder::NewStringabi:cxx11' followcollect2: error: ld returned 1 exit status
examples/CMakeFiles/nist.dir/build.make:114: recipe for target 'bin/nist' failed
make[2]: *** [bin/nist] Error 1
CMakeFiles/Makefile2:3653: recipe for target 'examples/CMakeFiles/nist.dir/all' failed
make[1]: *** [examples/CMakeFiles/nist.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2`
I wonder if I have installed any of the libs wrong, but I can not find it out.