Robotics StackExchange | Archived questions

ROS Lunar on Ubuntu 17.10, camera_info_manager build issue

Hello everybody ! I am trying to install ros lunar on my ubuntu 17.10 by building it from source. I want to do some AI for controlling a drone, but first I wanna try in a nice simulation. So I wanna use ros + gazebo. I am using this answer as a reference

https://answers.ros.org/question/277021/ros-lunar-on-ubuntu-1710/?answer=277081#post-id-277081

Using Docker with this
dockerfile https://gist.github.com/gavanderhoorn/28062c9ba78eed6cb098569a5b886896 I could have the build done but it failed badly on my machine :

[ 50%] Built target camera_info_manager
[ 75%] Linking CXX executable /home/alex/Project/ros/devel_isolated/camera_info_manager/lib/camera_info_manager/unit_test
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o: In function `check_url_substitution(ros::NodeHandle, 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&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
unit_test.cpp:(.text+0xbf4): undefined reference to `testing::internal::PrintStringTo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream*)'
unit_test.cpp:(.text+0xdf8): undefined reference to `testing::internal::PrintStringTo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream*)'
unit_test.cpp:(.text+0xffa): undefined reference to `testing::internal::EqFailure(char const*, char const*, 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&, bool)'
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o: In function `CameraName_validNames_Test::TestBody()':
unit_test.cpp:(.text+0x1ac9): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
unit_test.cpp:(.text+0x1b61): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
unit_test.cpp:(.text+0x1bf9): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
unit_test.cpp:(.text+0x1c91): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
unit_test.cpp:(.text+0x1d29): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o:unit_test.cpp:(.text+0x1dc1): more undefined references to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)' follow
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o: In function `compare_calibration(sensor_msgs::CameraInfo_<std::allocator<void> > const&, sensor_msgs::CameraInfo_<std::allocator<void> > const&)':
unit_test.cpp:(.text+0x7964): undefined reference to `testing::internal::EqFailure(char const*, char const*, 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&, bool)'
unit_test.cpp:(.text+0x7a41): undefined reference to `testing::internal::EqFailure(char const*, char const*, 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&, bool)'
unit_test.cpp:(.text+0x7b6c): undefined reference to `testing::internal::EqFailure(char const*, char const*, 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&, bool)'
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o: In function `GetInfo_uncalibrated_Test::TestBody()':
unit_test.cpp:(.text+0x897e): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o: In function `GetInfo_calibrated_Test::TestBody()':
unit_test.cpp:(.text+0x8e5e): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
unit_test.cpp:(.text+0x8f16): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
unit_test.cpp:(.text+0x8fce): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o: In function `GetInfo_fromPackage_Test::TestBody()':
unit_test.cpp:(.text+0x9566): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o:unit_test.cpp:(.text+0x961e): more undefined references to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)' follow
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o: In function `testing::AssertionResult testing::internal::CmpHelperEQ<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, 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&)':
unit_test.cpp:(.text._ZN7testing8internal11CmpHelperEQINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EENS_15AssertionResultEPKcSA_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EENS_15AssertionResultEPKcSA_RKT_RKT0_]+0x1e2): undefined reference to `testing::internal::PrintStringTo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream*)'
unit_test.cpp:(.text._ZN7testing8internal11CmpHelperEQINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EENS_15AssertionResultEPKcSA_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EENS_15AssertionResultEPKcSA_RKT_RKT0_]+0x629): undefined reference to `testing::internal::PrintStringTo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream*)'
unit_test.cpp:(.text._ZN7testing8internal11CmpHelperEQINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EENS_15AssertionResultEPKcSA_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EENS_15AssertionResultEPKcSA_RKT_RKT0_]+0x7fd): undefined reference to `testing::internal::EqFailure(char const*, char const*, 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&, bool)'
CMakeFiles/unit_test.dir/tests/unit_test.cpp.o: In function `testing::AssertionResult testing::internal::CmpHelperEQFailure<double, double>(char const*, char const*, double const&, double const&)':
unit_test.cpp:(.text._ZN7testing8internal18CmpHelperEQFailureIddEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal18CmpHelperEQFailureIddEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x6fb): undefined reference to `testing::internal::EqFailure(char const*, char const*, 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&, bool)'
collect2: error: ld returned 1 exit status
CMakeFiles/unit_test.dir/build.make:126: recipe for target '/home/alex/Project/ros/devel_isolated/camera_info_manager/lib/camera_info_manager/unit_test' failed
make[2]: *** [/home/alex/Project/ros/devel_isolated/camera_info_manager/lib/camera_info_manager/unit_test] Error 1
CMakeFiles/Makefile2:517: recipe for target 'CMakeFiles/unit_test.dir/all' failed
make[1]: *** [CMakeFiles/unit_test.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Asked by 221Bytes on 2018-02-23 11:27:49 UTC

Comments

I could have the build done but it failed badly on my machine

are you saying that the Docker build succeeded, but building it on the host (so not using Docker) failed?

Asked by gvdhoorn on 2018-02-23 12:07:13 UTC

Exactly :) Docker worked as expected but on my machine I got the errors I posted above.

Asked by 221Bytes on 2018-02-23 12:12:22 UTC

Seeing the cxx11 mentioned makes me think of C++11/C++SomethingElse linking issues (but it's really just a guess). Is this the only linker error you run into? Have you upgraded the compiler on the host?

Asked by gvdhoorn on 2018-02-23 12:18:53 UTC

Yes that's the only one and I remember upgrading my compiler for compiling nvidia drivers.I am using gcc-7 and g++-7 and I just tried with gcc-5 and g++5 but noting different appears.

Asked by 221Bytes on 2018-02-23 12:29:58 UTC

Have you deleted the devel_isolated and the build_isolated after switching compilers? Otherwise it could be reusing objects compiled with the previous compiler which may not work.

Asked by gvdhoorn on 2018-02-23 12:54:01 UTC

I am trying that now, which version of the compiler is recommended ?

Asked by 221Bytes on 2018-02-23 13:03:46 UTC

Just to test, I would try to use the same compiler as the Docker image contains.

Asked by gvdhoorn on 2018-02-23 13:09:13 UTC

I tried with gcc5 and gcc4.8 (and the g++ equivalent) just more mistakes and earlier in the compilation. Furthermore, I checked the docker image for ubuntu17.10 and it's using gcc7 (the one I was using at first) I feel a bit lost now :/

Asked by 221Bytes on 2018-02-23 13:15:19 UTC

I solved my problem by using a docker image https://hub.docker.com/r/221bytes/drone-simu/ Thanks for your help !

Asked by 221Bytes on 2018-02-25 17:01:35 UTC

Seeing as Artful is not yet officially supported there is always the possibility that from-source builds won't work. It would perhaps be an idea to report this somewhere though. Is camera_info_manager always the pkg that shows these errors?

Asked by gvdhoorn on 2018-02-26 02:42:09 UTC

Indeed, even if changing g++ versions showed different errors. At the end using the dockerfile I wrote with ubuntu 14 was my best shot. Where should I report it ?

Asked by 221Bytes on 2018-02-26 02:51:52 UTC

Answers