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

Revision history [back]

click to hide/show revision 1
initial version

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 relatively to the base directory of your package (not the base directory of your catkin workspace!!!!). The error message is fully consistens with what you mentioned:

Your source file is placed in

catkin_ws/src/rosberry_pichopter/joy/src/servo.cpp

CMake looks for the file in

catkin_ws/src/rosberry_pichopter/src/rosberry_pichopter/joy/src/servo.cpp

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 )

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!!!!). The I. e. the error message is fully consistens consistent with what you mentioned:

Your source file is placed in

catkin_ws/src/rosberry_pichopter/joy/src/servo.cpp

CMake looks for the file in

catkin_ws/src/rosberry_pichopter/src/rosberry_pichopter/joy/src/servo.cpp

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 )