I am currently in actions quiz, but I am having trouble trying to compile my CMakeLists.txt for some reason. I have already create my own action msg and it compiles just fine, but when I try to create my own action server, I cant compile it and it is giving me this error
/usr/bin/ld: CMakeFiles/actions_server_quiz.dir/src/actions_server_quiz.cpp.o: undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [actions_quiz/CMakeFiles/actions_server_quiz.dir/build.make:91: /home/user/catkin_ws/devel/lib/actions_quiz/actions_server_quiz] Error 1
make[1]: *** [CMakeFiles/Makefile2:443: actions_quiz/CMakeFiles/actions_server_quiz.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Invoking "make -j8 -l8" failed
I tried to search for some solution but people pointed out that it has got something to do with my library and that I need to compile it manually using symbols in the command line. The thing is that we are compiling it with catkin_make
and I dont see any way for me to get around this.
Here is my CMakeLists
cmake_minimum_required(VERSION 3.0.2)
project(actions_quiz)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
find_package(catkin REQUIRED COMPONENTS
actionlib_msgs
std_msgs
)
## Generate actions in the 'action' folder
add_action_files(
FILES
CustomActionMsg.action
)
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
actionlib_msgs
std_msgs # Or other packages containing msgs
)
catkin_package(
CATKIN_DEPENDS
roscpp
# INCLUDE_DIRS include
# LIBRARIES actions_quiz
# CATKIN_DEPENDS actionlib roscpp
# DEPENDS system_lib
)
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
add_executable(actions_server_quiz src/actions_server_quiz.cpp)
add_dependencies(actions_server_quiz ${actions_server_quiz_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(actions_server_quiz
${catkin_LIBRARIES}
)