Undefined reference to boost when compiling rviz [closed]
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 ROS_NOBUILD 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 catkin_make. 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 ...
What branch of rviz and ros distro are you using?
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...