Catkin build errro

I’m tryting to compile my ros package after creating a new one. I used catkin build cmd but get the following result:


Even the previously-created pkgs are abandoned or failed.
Appreciate for any help

Hi there, you can delete my_examples_pkg that you created previously and then again create it . For that go to the directory src which is inside the catkin_ws and then use the following command catkin_create_pkg my_examples_pkg rospy(or any other dependencies you need). Then you need to go the catkin_ws again by typing cd …/. Please note that catkin build works in the catkin_ws directory. It should now work, if it is still giving the same error, then you might have done some changes in the cmakelists and/or package.xml which have some formating issue, and that’s why catkin build is not able to compile your package. Once this is fine, all packages should compile successfully.

Hi,
The pkg My_example_pkg is actually deleted from src dir long before, and i don’t understand why it appears every time i compiles my pkgs. If i created it again,and do catkin build cmd, i will get error as shown below:

However, i think the essential problem is why other pkgs are considered as abandoned, in which case i can’t access my pkg with cd or roscd cmd

Hi there, I would recommend you to delete all the packages from the src folder to avoid confusion, you should never keep the same name for 2 packages as it causes confusion. You can also delete the src folder and then again create it. Once src is created, then you can again create packages in the newly created src folder. You can download the src folder before deleting it so that you have the backup. Also, you can try removing the build space using rm -rf build/ devel/ and then again build it using catkin build or catkin_make, you must also do source devel/setup.bash after building the workspace to update the variables. Also, you can’t use roscd until packages are compiled. I hope it will solve your issue. Cheers.

2 Likes

The problem seems to be that the packages were built with catkin_make initially. catkin build cannot be used alongside catkin_make.

Try removing the build and devel folders and compile again:

cd ~/catkin_ws
rm -rf build/ devel/
catkin build
source devel/setup.bash
1 Like

Thanks for all replys, the problem appears to be solved.

2 Likes