找不到-pthread库

I got this error 2 weeks ago.
Today! Finally! I deal with it!!!

Problem

can’t find the library ‘-pthread’.
在这里插入图片描述

CMake Error at /home/yummy/catkin_ws/devel/share/controller_manager/cmake/controller_managerConfig.cmake:150 (message):
  Project 'controller_manager_tests' tried to find library '-pthread'.  The
  library is neither a target nor built/installed properly.  Did you compile
  project 'controller_manager'? Did you find_package() it before the
  subdirectory containing its code is included?
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  ros_control-kinetic-devel/controller_manager_tests/CMakeLists.txt:7 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/yummy/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/yummy/catkin_ws/build/CMakeFiles/CMakeError.log".

Solution

finding methods

I have already tried so many function like: cmake and libpthread
But still can’t solve the problem…

Then I find this link about CMake Error: Project ‘nav_core’ tried to find library ‘-lpthread’. Here is just one short commit to telling us "The problem was caused by wrong cmake version".

So I try…

My OS is Ubuntu 16.04, ROS is kinetic. So the default Cmake version is 3.5.1. For installing RBDL, I upgrade CMake to 3.15.3.

What strange is that

  • some part of my system still is version 3.5.1, because when I run ccmake ., it showed the version 3.5.1
  • but when I run “cmake --version”, it showed me that 3.15.3.
Done!

I now downgrade the CMake version from 3.15.3 to 3.10.0-rc1. Then solve the problem:)

To solve this problem! Just by installing a lower version CMake.

The problem about finding franka and gazebo are also solved!!

I post the question in ROS Froum.

Install CMake with new version

following here

In http://www.cmake.org/files download the CMake, which you want.

sudo apt-get install build-essential
 
tar xf cmake-3.10.0-rc1
cd cmake-3.10.0-rc1
./configure
make

sudo make install

At last, check the version which you install.

cmake --version

If your version shows it correct in the terminal, that means success!!

发布了16 篇原创文章 · 获赞 1 · 访问量 265

猜你喜欢

转载自blog.csdn.net/weixin_45366564/article/details/103498632
今日推荐