Unable to colcon build exercise 3.1.1

I have been following 3.1.1 Planning to a joint-space goal exercise 3.1. I have followed the instruction on all the steps and tried to colcon build the package. It seems to present some error.

— stderr: moveit2_scripts
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/…/…/…/x86_64-linux-gnu/Scrt1.o: in function _start': (.text+0x1b): undefined reference to main’
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/test_trajectory.dir/build.make:351: test_trajectory] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/test_trajectory.dir/all]Error 2
gmake: *** [Makefile:146: all] Error 2

Failed <<< moveit2_scripts [21.1s, exited with code 2]

Summary: 8 packages finished [22.0s]
1 package failed: moveit2_scripts
1 package had stderr output: moveit2_scripts

can anyone suggest what i am doing wrong here.

Thank you
Narayan

Hi @naranpanthi99, this is an error with the cpp file you’re trying to compile in moveit2_scripts.

Does the script contain anything inside? when the error says no reference to main, it means there is no main function so maybe you forgot to add it.

Hello,

I have copied the exact script that is posted in the exercise and made no changes. I checked the script and found that there is main function included. I have also made addition to CmakeLists.txt and created the launch file as instructed.

Thank you
Narayan

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.