ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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 )
2 | No.2 Revision |
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 )