DeepLoco icon indicating copy to clipboard operation
DeepLoco copied to clipboard

undefined reference in ../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so

Open epsilonkei opened this issue 6 years ago • 3 comments

Thank you for your help in the previous issue. However I still get another error when run the command make config=debug64

==== Building deepLocoUtil (debug64) ====
==== Building deepLocoAnim (debug64) ====
==== Building deepLocoLearning (debug64) ====
==== Building deepLocoSim (debug64) ====
==== Building deepLocoRender (debug64) ====
==== Building deepLocoScenarios (debug64) ====
==== Building DeepLoco (debug64) ====
Linking DeepLoco
../x64/Debug/libdeepLocoLearning.a(NeuralNet.o): 関数 `cNeuralNet::LoadScale(std::string const&)' 内:
/home/kangaroo/LocomotionRL/DeepLoco/gmake/../learning/NeuralNet.cpp:141: `Json::Value::operator[](std::string const&)' に対する定義されていない参照です
/home/kangaroo/LocomotionRL/DeepLoco/gmake/../learning/NeuralNet.cpp:144: `Json::Value::operator[](std::string const&)' に対する定義されていない参照です
/home/kangaroo/LocomotionRL/DeepLoco/gmake/../learning/NeuralNet.cpp:159: `Json::Value::operator[](std::string const&)' に対する定義されていない参照です
/home/kangaroo/LocomotionRL/DeepLoco/gmake/../learning/NeuralNet.cpp:162: `Json::Value::operator[](std::string const&)' に対する定義されていない参照です
/home/kangaroo/LocomotionRL/DeepLoco/gmake/../learning/NeuralNet.cpp:177: `Json::Value::operator[](std::string const&)' に対する定義されていない参照です
../x64/Debug/libdeepLocoLearning.a(NeuralNet.o):/home/kangaroo/LocomotionRL/DeepLoco/gmake/../learning/NeuralNet.cpp:180: `Json::Value::operator[](std::string const&)' に対する定義されていない参照がさらに続いています

[...]

../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::end() const@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::empty() const@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(unsigned long, char, std::allocator<char> const&)@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::insert(unsigned long, char const*)@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char)@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21' に対する定義されていない参照です
../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21' に対する定義されていない参照です
collect2: error: ld returned 1 exit status
make[1]: *** [../x64/Debug/DeepLoco] エラー 1
make: *** [DeepLoco] エラー 2

The error was written in Japanese, but for example

../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21' に対する定義されていない参照です

means

../external/jsoncpp/build/debug/src/lib_json/libjsoncpp.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21' 

My OS environment is Ubuntu 14.04.

epsilonkei avatar May 18 '18 06:05 epsilonkei

You might need to recompile the jsoncpp library for Ubuntu 14.04. I compiled it on 16.04 for this work.

Neo-X avatar May 18 '18 15:05 Neo-X

I have successfully rebuilt jsoncpp using cmake following the instruction here https://github.com/open-source-parsers/jsoncpp/wiki/Building Then I run the command

cp external/jsoncpp/build/debug/src/lib_json/*.so* lib/

to overwrite .so files

After that, I deleted the gmake folder and run these commands again.

premake4 clean
premake4 gmake
cd gmake
make config=debug64

However I still got same error.

epsilonkei avatar May 21 '18 13:05 epsilonkei

Sorry for late update. It falied since my careless mistake.

I have successfully rebuilt jsoncpp using cmake following the instruction here https://github.com/open-source-parsers/jsoncpp/wiki/Building

Here, the compiling command should be

cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" ../..

instead of

cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" ../..

It can solve this error. However, same as #20, I can't found the two executable files. Could anyone please help? Thanks alot for your time.

epsilonkei avatar Aug 05 '18 08:08 epsilonkei