Compile_error - C++ for robotics

Hello,

user:~/catkin_ws$ cd ~/catkin_ws/src/cpp_course_repo/utilities/
user:~/catkin_ws/src/cpp_course_repo/utilities$ g++ -std=c++11 file.cpp -o name_compiled
/usr/lib/gcc/x86_64-linux-gnu/5/…/…/…/x86_64-linux-gnu/crt1.o: In function _start': (.text+0x20): undefined reference to main’
collect2: error: ld returned 1 exit status

What is the reason for this error?

Regards,

This that your main function does not exist or you are trying to call it before it’s defined. You fix that :slight_smile:

Could you elaborate more? How can I do it?

Please carefully follow the instructions in the notes, making sure you are not missing or skipping anything and you should be good.

Did you define another main() function in your code, other than int main() in the beginning?

If you are calling main() function from inside your, int main(), this might cause compilation errors. Please carefully read the documentation, everything is well tested, should have no issues upon careful implementation.