ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is not ROS-related, but is a CMake question.

You're compiling all of your source files (ie: .cpp) as individual executables (via add_executable(..)).

The linker will expect a int main(..) function in each of those .cpps in that case.

It doesn't find one, hence the error message.

I would suggest to become a bit more proficient with CMake, as it will make many things less confusing and/or complex. And not just in/with ROS, but in general when writing and building programs.