ROS Lunar on Ubuntu 17.10, camera_info_manager build issue [closed]
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/2770...
Using Docker with this
dockerfile https://gist.github.com/gavanderhoorn... 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 ...
are you saying that the Docker build succeeded, but building it on the host (so not using Docker) failed?
Exactly :) Docker worked as expected but on my machine I got the errors I posted above.
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?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.
Have you deleted the
devel_isolated
and thebuild_isolated
after switching compilers? Otherwise it could be reusing objects compiled with the previous compiler which may not work.I am trying that now, which version of the compiler is recommended ?
Just to test, I would try to use the same compiler as the Docker image contains.
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 :/