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

The compiler isn't compiling add.cpp because it doesn't know it needs to, and thus it can't find the definition of add(int, int). You need to make add.cpp a source file in cmake. You would do that in add_executable. It would look like this:

add_executable(shortest_path src/main.cpp src/add.cpp)

You should also probably put your add.h file in the include folder, especially if you want other nodes to be able to see add.h. Keep going through the tutorials!