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

Do not understand reason for compile error

asked 2014-02-28 13:47:55 -0500

flb gravatar image

Consider the following partial application in my new Hydro installation

#include <ros/ros.h>
int main(int argc, char** argv) {
//...
ros::start();
//...
}

when compiled with

g++  -I/opt/ros/hydro/include

I get the error: "undefined reference to 'ros::start()'"

There is no error about a missing include and I even included <ros init.h=""> and got the same error. I can see ROSCPP_DECL void start();

Does anybody know why I get this compile error?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2014-02-28 15:08:32 -0500

demmeln gravatar image

updated 2014-03-01 05:09:02 -0500

It is a linker error. You will have to link against libroscpp.

Edit:

You might find these excellent tutorials by Jonathan Bohren useful. They explain step by step and bottom up how programs using ROS are built and how this is aided by catkin.

  1. http://jbohren.com/articles/roscpp-he...
  2. http://jbohren.com/articles/gentle-ca...
  3. http://jbohren.com/articles/modular-r...
edit flag offensive delete link more

Comments

That was it, thanks.

flb gravatar image flb  ( 2014-03-01 02:48:55 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-02-28 13:47:55 -0500

Seen: 184 times

Last updated: Mar 01 '14