Gazebo | Ignition | Community
Ask Your Question

Building gazebo plugins with eclipse

asked 2016-12-22 16:55:40 -0500

graffy gravatar image

updated 2016-12-22 16:58:02 -0500


I'm trying to set up a gazebo plugin project under Eclipse. I'm using a simple example to try to make it work, but for some reason, it won't link against the SDFormat libararies.

I've set up the plugin and added the header files that are installed in my /user/include path, and the IDE picks them up just fine.

But, when I compile, it errors on public: void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);

The error is: 'ElementPtr’ in namespace ‘sdf’ does not name a type

I've provided paths to the SDFormat libraries (,,, so it should see everything fine.

Compiling using the cmake / make process outlined in the tutorials works ok, bu tI really want to do this from an Eclipse environment.

Any tips?

The sample code:


#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>
#include <sdf/Element.hh>

namespace gazebo {

class SonarListener: public gazebo::ModelPlugin {

    virtual ~SonarListener();

    public: void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-01-15 19:55:49 -0500

graffy gravatar image

I'm not really sure why the errors occurred, but following the tutorial here on integrating CMake with Eclipse was a big help:

It may have been also the need to specify the compiler switch -std=c++11 under the compiler options in the C++ preprocessor provider settings in project properties.

In any case, I eventually got it to compile and run well, and have since set up several other projects with no issue.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-12-22 16:55:40 -0500

Seen: 906 times

Last updated: Jan 15 '17