ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

CMake Error: Project 'nav_core' tried to find library '-lpthread'

asked 2019-01-27 06:18:03 -0500

standmit gravatar image

I can't to build navigation stack ( ). My system is: Ubuntu 16.04 4.15.0-43-generic, ROS Kinetic. What I do:

mkdir -p navigation_ws/src
cd navigation_ws/src
git clone -b kinetic-devel
cd ..

The error message is:

CMake Error at /home/username/navigation_ws/devel/share/costmap_2d/cmake/costmap_2dConfig.cmake:148 (message):
  Project 'nav_core' tried to find library '-lpthread'.  The library is
  neither a target nor built/installed properly.  Did you compile project
  'costmap_2d'? 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)
  navigation/nav_core/CMakeLists.txt:4 (find_package)

Then I found that '-l-lpthread' instead of '-lpthread' presents in files: devel/lib/pkgconfig/costmap_2d.pc, build/navigation/costmap_2d/catkin_generated/, build/navigation/costmap_2d/catkin_generated/ and build/navigation/costmap_2d/catkin_generated/installspace/costmap_2d.pc

Please, help to solve this problem.

edit retag flag offensive close merge delete



I believe this is a duplicate of #q311753 and #q311685, although you're using Ubuntu.

gvdhoorn gravatar image gvdhoorn  ( 2019-01-27 10:33:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-04-03 00:49:15 -0500

standmit gravatar image

The problem was caused by wrong cmake version

edit flag offensive delete link more


Hi! I also have this problem, my ROS still is CMake 3.5.1. But because I upgrade CMake to 3.15.3, so now when I run "cmake --version", it shows me that 3.15.3. Does that mean I should downgrade CMake?

Yummy_Ou gravatar image Yummy_Ou  ( 2019-12-11 03:53:49 -0500 )edit

I solve it! In my link It is because of the higher version! Thanks~

Yummy_Ou gravatar image Yummy_Ou  ( 2019-12-11 06:06:13 -0500 )edit

I has checked several versions of CMake, and has found that 'navigation' successfully builds with CMake up to 3.13.2 inclusive

standmit gravatar image standmit  ( 2019-12-12 04:03:18 -0500 )edit

interesting... thanks for your information!

Yummy_Ou gravatar image Yummy_Ou  ( 2019-12-12 06:17:44 -0500 )edit

Question Tools

1 follower


Asked: 2019-01-27 06:18:03 -0500

Seen: 2,380 times

Last updated: Apr 03 '19