I am trying to use pthread library inside the ros Node, I am including it as #include <pthread>. When I run catkin_make I get the error below. I created a simple thread as std::thread m1(move, 1);
thread: No such file or directory
#include <pthread>
^~~~~~~~~
The signature of the move function is void move(short axis_no, short direction = 0) and I instantiated the thread as
std::thread m1(move, 1);
m1.join();
I tried to add the pthread library in my CmakeLists.txt as follows
add_compile_options(-std=c++11 -pthread) and
target_link_libraries(pthread). Is there a way I can use the pthread library inside the ros Node?
Thank you.