Unit 3 catkin build error

Here I did as the guide and got an error return
user:~/catkin_ws$ catkin build
The build space at ‘/home/user/catkin_ws/build’ was previously built by ‘catkin_make’. Please remove the build space or pick a different build space.

So I used the catkin build command inside the my_example_pkg dir

user:~/catkin_ws/src/my_example_pkg$ catkin build
[build] Summary: All 1 packages succeeded!

user:~/catkin_ws/src/my_example_pkg$ source devel/setup.bash
user:~/catkin_ws/src/my_example_pkg$ rosrun my_examples_pkg simple_topic_publisher.py
[rospack] Error: package ‘my_examples_pkg’ not found

Im pretty sure if you delete the ‘build’ and ‘devel’ folders in your catkin_ws, then run catkin build as you did initially to get the error (in the ~/catkin_ws directory), it will rebuild with the structure of catkin build instead of catkin_make without that first error you got.


Hello @fahd22222 ,

As @nickpulsone213 suggests, this is a problem of mixing compilation methods. If you remove the build and devel folders and recompile your workspace, it will get solved.

1 Like