Ask Your Question
0

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

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

standmit gravatar image

I can't to build navigation stack ( https://github.com/ros-planning/navig... ). 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
catkin_init_workspace
git clone -b kinetic-devel https://github.com/ros-planning/navigation
cd ..
catkin_make

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/pkg.installspace.context.pc.py, build/navigation/costmap_2d/catkin_generated/pkg.develspace.context.pc.py and build/navigation/costmap_2d/catkin_generated/installspace/costmap_2d.pc

Please, help to solve this problem.

edit retag flag offensive close merge delete

Comments

1

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

gvdhoorn gravatar imagegvdhoorn ( 2019-01-27 10:33:29 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

standmit gravatar image

The problem was caused by wrong cmake version

edit flag offensive delete link more

Comments

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 imageYummy_Ou ( 2019-12-11 03:53:49 -0600 )edit

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

Yummy_Ou gravatar imageYummy_Ou ( 2019-12-11 06:06:13 -0600 )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 imagestandmit ( 2019-12-12 04:03:18 -0600 )edit

interesting... thanks for your information!

Yummy_Ou gravatar imageYummy_Ou ( 2019-12-12 06:17:44 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

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

Seen: 1,044 times

Last updated: Apr 03 '19