I encountered an error with the CMakeList section 2.6 where it asks to use the
add_executable(simple_node src/simple.cpp)
line to create the executable from our cpp file. I followed the instructions verbatim but I kept running into an issue when trying to build it with colcon build where it was not finding the cpp file until I took the src/ out and just ran it as follows:
add_executable(simple_node simple.cpp)
That seemed to work, but my follow-up question is whether this is a bug with the IDE or if when I am building packages on my own, I will need to specify the path to the src folder or if it will automatically check the src folder for the package? I even tried using the absolute path to the file and still got the “cannot find source file” errors, so I just want to know what the proper syntax will be for future projects.
Thanks!