Linking error when catkin_make actionlib tutorial
I'm adding catkin
version to actionlib
tutorial. I'm able to create .msg
and .h
files by catkin_make
(so that tutorial is updated) but building .cpp file fails with the following error. Any idea?
Linking CXX executable /useri/ROS/groovy_precise/Tutorial_ROS/catkin_ws_common_tutorials/devel/lib/learning_actionlib/fibonacci_server
[ 86%] [ 95%] Built target learning_actionlib_genpy
Built target learning_actionlib_gencpp
CMakeFiles/fibonacci_server.dir/src/fibonacci_server.cpp.o: In function `main':
fibonacci_server.cpp:(.text+0x70): undefined reference to `ros::init(int&, char**, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
fibonacci_server.cpp:(.text+0x93): undefined reference to `ros::this_node::getName()'
fibonacci_server.cpp:(.text+0xd5): undefined reference to `ros::spin()'
CMakeFiles/fibonacci_server.dir/src/fibonacci_server.cpp.o: In function `ros::Duration::Duration(double)':
fibonacci_server.cpp:(.text._ZN3ros8DurationC2Ed[_ZN3ros8DurationC5Ed]+0x2b): undefined reference to `ros::DurationBase<ros::Duration>::fromSec(double)'
CMakeFiles/fibonacci_server.dir/src/fibonacci_server.cpp.o: In function `boost::detail::thread_data_base::thread_data_base()':
fibonacci_server.cpp:(.text._ZN5boost6detail16thread_data_baseC2Ev[_ZN5boost6detail16thread_data_baseC5Ev]+0x24): undefined reference to `vtable for boost::detail::thread_data_base'
CMakeFiles/fibonacci_server.dir/src/fibonacci_server.cpp.o: In function `boost::detail::interruption_checker::interruption_checker(pthread_mutex_t*, pthread_cond_t*)':
fibonacci_server.cpp:(.text._ZN5boost6detail20interruption_checkerC2EP15pthread_mutex_tP14pthread_cond_t[_ZN5boost6detail20interruption_checkerC5EP15pthread_mutex_tP14pthread_cond_t]+0x16): undefined reference to `boost::detail::get_current_thread_data()'
CMakeFiles/fibonacci_server.dir/src/fibonacci_server.cpp.o: In function `FibonacciAction::FibonacciAction(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
fibonacci_server.cpp:(.text._ZN15FibonacciActionC2ESs[_ZN15FibonacciActionC5ESs]+0x4e): undefined reference to `ros::NodeHandle::NodeHandle(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
:
(entire output is available here)
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(learning_actionlib)
find_package(catkin REQUIRED COMPONENTS roscpp actionlib std_msgs actionlib_msgs genmsg message_generation)
find_package(Boost REQUIRED COMPONENTS system)
add_action_files(
DIRECTORY action
FILES Fibonacci.action
)
generate_messages(
DEPENDENCIES std_msgs actionlib_msgs # Or other packages containing msgs
)
catkin_package(
# INCLUDE_DIRS include
CATKIN_DEPENDS roslib roscpp actionlib message_generation
)
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
add_executable(fibonacci_server src/fibonacci_server.cpp)