cmake compile error: pthread not found, how to tell the compiler to look for pthread lib?
Hi all, I run into a compile error while installing Melodic on Debian9-- Stretch.
Basically, I followed the instructions here on a freshly installed Debian9 and had the following error when I was executing this cmd ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
:
CMake Error at /home/parallels/ros_catkin_ws/devel_isolated/class_loader/share/class_loader/cmake/class_loaderConfig.cmake:148 (message):
Project 'class_loader' tried to find library '-lpthread'. The library is
neither a target nor built/installed properly. Did you compile project
'class_loader'? Did you find_package() it before the subdirectory
containing its code is included?
Call Stack (most recent call first):
/home/parallels/ros_catkin_ws/install_isolated/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
test/CMakeLists.txt:4 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/parallels/ros_catkin_ws/build_isolated/class_loader/CMakeFiles/CMakeOutput.log".
See also "/home/parallels/ros_catkin_ws/build_isolated/class_loader/CMakeFiles/CMakeError.log".
<== Failed to process package 'class_loader':
Command '['/home/parallels/ros_catkin_ws/install_isolated/env.sh', 'cmake', '/home/parallels/ros_catkin_ws/src/class_loader', '-DCATKIN_DEVEL_PREFIX=/home/parallels/ros_catkin_ws/devel_isolated/class_loader', '-DCMAKE_INSTALL_PREFIX=/home/parallels/ros_catkin_ws/install_isolated', '-DCMAKE_BUILD_TYPE=debug', '-G', 'Unix Makefiles']' returned non-zero exit status 1
Reproduce this error by running:
==> cd /home/parallels/ros_catkin_ws/build_isolated/class_loader && /home/parallels/ros_catkin_ws/install_isolated/env.sh cmake /home/parallels/ros_catkin_ws/src/class_loader -DCATKIN_DEVEL_PREFIX=/home/parallels/ros_catkin_ws/devel_isolated/class_loader - DCMAKE_INSTALL_PREFIX=/home/parallels/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=debug -G 'Unix Makefiles'
A similar error was found here, but there's no effective solution to that problem.
What CMake version do you have? I ran into this with Gentoo not that long ago. https://github.com/ros/ros-overlay/is...
Mine is cmake 3.13.2. Will updating the cmake make a difference? Or there's a compatible version to compile it?
Try cmake < 3.13. That seemed to fix my issues on Gentoo. Still working on a patch for this.
Thanks for the suggestion. I'll give it a try!
I might have used the cmake 3.7.2 as when i used `apt-cache madsion cmake', it came out 3.7.2. But when I run cmake --version, it gave me 3.12.2.