Undefined Reference to boost
Hi guys, I've been getting this error lately every time I compile my ethzasl_sensor_fusion.
The error I received is below:
Linking CXX executable ../bin/pose_sensor
CMakeFiles/pose_sensor.dir/src/main.o: In function __static_initialization_and_destruction_0':
/usr/local/include/boost/system/error_code.hpp:214: undefined reference to
boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:215: undefined reference to boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:216: undefined reference to
boost::system::system_category()'
CMakeFiles/pose_sensor.dir/src/pose_sensor.o: In function __static_initialization_and_destruction_0':
/usr/local/include/boost/system/error_code.hpp:214: undefined reference to
boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:215: undefined reference to boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:216: undefined reference to
boost::system::system_category()'
collect2: ld returned 1 exit status
make[3]: * [../bin/pose_sensor] Error 1
make[3]: Leaving directory /home/fyp4211/ROS_Pack/ethzasl_sensor_fusion/ssf_updates/build'
make[2]: *** [CMakeFiles/pose_sensor.dir/all] Error 2
make[2]: Leaving directory
/home/fyp4211/ROS_Pack/ethzasl_sensor_fusion/ssf_updates/build'
make[1]: * [all] Error 2
make[1]: Leaving directory `/home/fyp4211/ROS_Pack/ethzasl_sensor_fusion/ssf_updates/build'
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package ssf_updates written to:
[ rosmake ] /home/fyp4211/.ros/rosmake/rosmake_output-20130401-152352/ssf_updates/build_output.log
The cmake file is shown below:
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)
rosbuild_init()
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
#gencfg()
rosbuild_genmsg()
add_definitions (-Wall)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# get eigen
find_package(Eigen REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS})
rosbuild_add_boost_directories()
rosbuild_add_executable(pose_sensor src/main.cpp src/pose_sensor.cpp)
rosbuild_link_boost(pose_sensor filesystem system)
set_property(TARGET pose_sensor PROPERTY COMPILE_DEFINITIONS POSE_MEAS)
rosbuild_add_compile_flags(pose_sensor "-O3")
target_link_libraries(pose_sensor ssf_core)
rosbuild_add_boost_directories()
rosbuild_add_executable(position_sensor src/main.cpp src/position_sensor.cpp)
rosbuild_link_boost(position_sensor filesystem system)
set_property(TARGET position_sensor PROPERTY COMPILE_DEFINITIONS POSITION_MEAS)
rosbuild_add_compile_flags(position_sensor "-O3")
target_link_libraries(position_sensor ssf_core)
Can you guys help me out with this problem. Thanks!!