Ask Your Question
0

CMAKE_HAVE_LIBC_PTHREAD failed

asked 2021-11-14 18:44:57 -0600

victorlu gravatar image

Hello there,

I was trying to compile my package and generate a debian package according to (this post) [https://answers.ros.org/question/1738...]

I have got cmake error thay says CMAKE_HAVE_LIBC_PTHREAD failed ./obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/./obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/src.c:11: undefined reference to `pthread_create' /usr/bin/ld: ./obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/./obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/src.c:12: undefined reference to `pthread_detach' /usr/bin/ld: ./obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/./obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/src.c:13: undefined reference to `pthread_join' collect2: error: ld returned 1 exit status The libthread (v2.31) is installed on my machine and I can compile my package with catkin without any error. I found it is hard to track the source of error. If someone has any idea about it, I would really appreciate your help.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-11-15 01:32:43 -0600

victorlu gravatar image

It turns out that cmake didn’t find one of my customized package. I don’t know why it will trigger the failure of pthread test. Once I change Cmake and package file and recompile, I can get deb without any error.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-11-14 18:19:07 -0600

Seen: 21 times

Last updated: Nov 15 '21