Ask Your Question

Catkin_make error

asked 2014-09-16 19:43:36 -0600

dshimano gravatar image

Hello, I'm having a problem with catkin_make. When I run run it i get

-- Using these message generators: gencpp;genlisp;genpy
-- tum_ardrone: 1 messages, 5 services
-- Configuring done
CMake Error at rosberry_pichopter/CMakeLists.txt:94 (add_library):
  Cannot find source file:


  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx

-- Build files have been written to: /home/donni/catkin_ws/build
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

With a bunch of stuff before it. I don't know why I'm getting the error, becouse servo.cpp is in catkin_ws/src/rosberry_pichopter/joy/src/servo.cpp. I'm using hydro.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-09-17 01:40:15 -0600

Wolf gravatar image

updated 2014-09-17 01:43:19 -0600

The error:

CMake Error at rosberry_pichopter/CMakeLists.txt:94 (add_library):
  Cannot find source file:

Means that cmake is looking for the file and did not find it. It looks for the file relatively to the base directory of your package (not the base directory of your catkin workspace!!!!). I. e. the error message is fully consistent with what you mentioned:

Your source file is placed in


CMake looks for the file in


The reason, I guess, is that you a have an add_executable or add_library in your CMakeLists.txt which looks like:

add_executable( your_target src/rosberry_pichopter/joy/src/servo.cpp )

while it should rather look like:

add_executable( your_target joy/src/servo.cpp )
edit flag offensive delete link more

answered 2014-09-16 19:59:19 -0600

Thiagopj gravatar image

Probably your CMakeList is trying to find you 'servo.cpp' in 'rosberry_pichopter/src/servo.cpp'.

Look at add_executable and include_directories.

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

1 follower


Asked: 2014-09-16 19:43:36 -0600

Seen: 2,742 times

Last updated: Sep 17 '14