Undefined reference to boost when compiling rviz
Hi there,
originally I was trying to follow the tutorial on building plugins for rviz. After setting up everything and changing a few things it finally compiled. But on loading the plugin in rviz, rviz would segfault reproducably. I then tried to solve that, but somehow failed. The precompiled tutorial that came with sudo apt-get install ros-visualization-tutorials
worked. I then copied those sources to my workspace and recompiled and again rviz would segfault. A colleague of mine then suggested recompiling rviz form source, as this may fix issues with different shared libraries in use. So I downloaded the sources from the repository and set up a workspace.
The rviz page then said to use rosmake rviz to compile but that wouldn't work since there was no Makefile and it kept complaining about a ROSNOBUILD flag. I tried removing that with rosmake -u rviz, but somehow it didn't work.
Since the CMakeLists.txt uses catkin commands I then used catkinmake. It seemed to work until this error appeared:
[ 69%] Generating tools/moc_interaction_tool.cxx
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::codecvt()'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `typeinfo for boost::program_options::error_with_option_name'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::error_with_option_name::what() const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::extension() const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::parent_path() const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::detail::rename(boost::filesystem::path const&, boost::filesystem::path const&, boost::system::error_code*)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::thread::start_thread_noexcept()'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `vtable for boost::program_options::error_with_option_name'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::detail::cmdline::get_canonical_option_prefix()'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::filename() const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::compare(boost::filesystem::path const&) const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::detail::is_empty(boost::filesystem::path const&, boost::system::error_code*)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::thread::join_noexcept()'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::error_with_option_name::error_with_option_name(std::string const&, std::string const&, std::string const&, int)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/haf/rviz_ws/devel/lib/rviz/rviz] Error 1
make[1]: *** [rviz/src/rviz/CMakeFiles/executable.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 69%] Generating tools/moc_point_tool.cxx
[ 70%] Generating view_controllers/moc_orbit_view_controller.cxx
[ 70%] Generating view_controllers/moc_xy_orbit_view_controller.cxx
[ 70%] Generating view_controllers/moc_fixed_orientation_ortho_view_controller.cxx
[ 70%] Generating view_controllers/moc_fps_view_controller.cxx
Scanning dependencies of target default_plugin
[ 70%] [ 70%] Building CXX object rviz/src/rviz/default_plugin/CMakeFiles/default_plugin.dir/axes_display.cpp.o
Building CXX object rviz/src/rviz/default_plugin/CMakeFiles/default_plugin.dir/camera_display.cpp.o
Linking CXX executable /home/haf/rviz_ws/devel/lib/rviz/image_view
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::codecvt()'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `typeinfo for boost::program_options::error_with_option_name'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::error_with_option_name::what() const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::extension() const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::parent_path() const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::detail::rename(boost::filesystem::path const&, boost::filesystem::path const&, boost::system::error_code*)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::thread::start_thread_noexcept()'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `vtable for boost::program_options::error_with_option_name'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::detail::cmdline::get_canonical_option_prefix()'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::filename() const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::compare(boost::filesystem::path const&) const'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::detail::is_empty(boost::filesystem::path const&, boost::system::error_code*)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::thread::join_noexcept()'
/home/haf/rviz_ws/devel/lib/librviz.so: undefined reference to `boost::program_options::error_with_option_name::error_with_option_name(std::string const&, std::string const&, std::string const&, int)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/haf/rviz_ws/devel/lib/rviz/image_view] Error 1
make[1]: *** [rviz/src/image_view/CMakeFiles/rviz_image_view.dir/all] Error 2}
I then tried reinstalling boost, thinking the error might be somewhere there, but to no result. On some page I then read that ros uses boost 1.48 and installed that, but the error stayed the same. Right now I am back on 1.53
Can anybody help me? What am I missing? Thanks in advance!
Asked by neandertaler19 on 2013-09-17 05:00:04 UTC
Comments
What branch of rviz and ros distro are you using?
Asked by dgossow on 2013-09-29 11:27:02 UTC
I am using the groovy branch for both. I somehow fixed the problem now by compiling rviz on a newly set up machine. Now it will run with the tutorials compiled by me and will run plugins I wrote and compiled. Is somehow a workaround, but fixes my problem for now...
Asked by neandertaler19 on 2013-09-30 20:48:50 UTC