Rosanswers logo


I am using Ubuntu 10.04 and trying to recompile ROS Electric from source against boost version 1.46.1 (needed for my libraries). The default version used by ROS is 1.40.

The problem is somewhat related to this one but I have already tried to edit the boost versions and paths in my bashrc as shown, with no success.

The build output can be seen here: http://pastebin.com/R5TSA3kE

It seems that it cannot recognize the boost. But how is this possible? I have already verified that boost version 1.46.1 is installed in /usr/local.

Thanks in advance.

edit: I have opened a defect ticket, but I am not sure if this error is reproducible since another user have already compiled Electric against 1.46.1. I am still looking for an answer in the ROS CMakeFiles. Setting verbose=1 I found out that the actual command does only includes the thread and signals libraries from boost, but not the filesystem or system:

Linking CXX executable ../rosout
/usr/bin/cmake -E cmake_link_script CMakeFiles/rosout.dir/link.txt --verbose=1
/usr/bin/c++ -O2 -g -Wl,-rpath,/home/caris/ros/ros_comm/clients/cpp/roscpp/lib -Wl,-rpath,/home/caris/ros/ros_comm/clients/cpp/roscpp_serialization/lib -Wl,-rpath,/home/caris/ros/ros_comm/utilities/xmlrpcpp/lib -Wl,-rpath,/home/caris/ros/ros_comm/tools/rosconsole/lib -Wl,-rpath,/home/caris/ros/ros/core/roslib/lib -Wl,-rpath,/home/caris/ros/ros_comm/tools/rosconsole/lib -Wl,-rpath,/home/caris/ros/ros_comm/utilities/rostime/lib -Wl,-rpath,/home/caris/ros/ros_comm/utilities/cpp_common/lib -Wl,-rpath,/home/caris/ros/ros/core/roslib/lib -Wl,-rpath,/home/caris/ros/ros/tools/rospack/lib -pthread CMakeFiles/rosout.dir/rosout.o -o ../rosout -rdynamic -L/home/caris/ros/ros_comm/clients/cpp/roscpp/lib -L/home/caris/ros/ros_comm/clients/cpp/roscpp_serialization/lib -L/home/caris/ros/ros_comm/utilities/xmlrpcpp/lib -L/home/caris/ros/ros_comm/tools/rosconsole/lib -L/home/caris/ros/ros/core/roslib/lib -L/home/caris/ros/ros_comm/utilities/rostime/lib -L/home/caris/ros/ros_comm/utilities/cpp_common/lib -L/home/caris/ros/ros/tools/rospack/lib -lros -lboost_signals -lroscpp_serialization -lXmlRpc -lrosconsole -lboost_thread -llog4cxx -lrostime -lcpp_common -lroslib -lrospack -lrosstack -Wl,-rpath,/home/caris/ros/ros_comm/clients/cpp/roscpp/lib:/home/caris/ros/ros_comm/clients/cpp/roscpp_serialization/lib:/home/caris/ros/ros_comm/utilities/xmlrpcpp/lib:/home/caris/ros/ros_comm/tools/rosconsole/lib:/home/caris/ros/ros/core/roslib/lib:/home/caris/ros/ros_comm/utilities/rostime/lib:/home/caris/ros/ros_comm/utilities/cpp_common/lib:/home/caris/ros/ros/tools/rospack/lib

As we can see there are no -lboost_filesystem or -lboost_system flags, which could explain the errors.

But my question is: where can I set these flags? I have already made sure that my CMakeLists.txt from libros has this exact line:

rosbuild_link_boost(ros thread signals filesystem system)

which, in my point of view, should include all the pre-mentioned libraries.

Originally posted by agoto on ROS Answers with karma: 46 on 2012-08-30

Post score: 0

Original comments

Comment by joq on 2012-08-30:
Are you setting $ROS_BOOST_VERSION?

Comment by agoto on 2012-08-31:
Yes, I am. I have edited my .bashrc in order to take into account for the new changes, by including these lines:

export ROS_BOOST_ROOT="/usr/local/"

export ROS_BOOST_VERSION="1.46.1"


1 Answer 1


Rosanswers logo

Ok. It seems there is a way to trick ROS CMakeFiles, since it seems that rosbuild isn't linking the libraries properly.

I added:

find_package(Boost 1.46.1 COMPONENTS thread signals filesystem system)

    target_link_libraries(ros ${Boost_LIBRARIES})

in the file: ~/ros/ros_comm/clients/cpp/roscpp/src/libros/CMakeLists.txt

That allowed me to go past the compilation. There is a similar problem with rosbag CMakeLists.txt as well, but the same applies. This is probably a bug and hopefully it will be fixed.

Unfortunately it doesn't seem this is the end since I have another issue, this time with roscore. But this will be the subject for another question.

Originally posted by agoto with karma: 46 on 2012-09-07

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.