Ask Your Question
1

Compiling issue Hector Quadcopter

asked 2016-10-19 20:31:21 -0600

jbourne gravatar image

updated 2016-10-19 21:04:01 -0600

I am using Ubuntu 16.04 with ROS kinetic. I am following this tutorial for hector quadcopter. I am also installing this package from source. After git cloning driver_common from here, I get this error when I try to catkin_make.

[  3%] Building CXX object hector_gazebo/hector_gazebo_plugins/CMakeFiles/hector_servo_plugin.dir/src/servo_plugin.cpp.o
In file included from /usr/include/c++/5/random:35:0,
                 from /usr/include/ignition/math2/ignition/math/Rand.hh:20,
                 from /usr/include/ignition/math2/ignition/math.hh:18,
                 from /usr/include/sdformat-4.0/sdf/Param.hh:34,
                 from /usr/include/sdformat-4.0/sdf/Element.hh:24,
                 from /usr/include/sdformat-4.0/sdf/sdf.hh:5,
                 from /usr/include/gazebo-7/gazebo/common/Plugin.hh:42,
                 from /home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/include/hector_gazebo_plugins/diffdrive_plugin_6w.h:30,
                 from /home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_6w.cpp:36:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
In file included from /usr/include/c++/5/random:35:0,
                 from /usr/include/ignition/math2/ignition/math/Rand.hh:20,
                 from /usr/include/ignition/math2/ignition/math.hh:18,
                 from /usr/include/sdformat-4.0/sdf/Param.hh:34,
                 from /usr/include/sdformat-4.0/sdf/Element.hh:24,
                 from /usr/include/sdformat-4.0/sdf/sdf.hh:5,
                 from /usr/include/gazebo-7/gazebo/common/Plugin.hh:42,
                 from /home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/include/hector_gazebo_plugins/reset_plugin.h:32,
                 from /home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/reset_plugin.cpp:29:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
In file included from /usr/include/c++/5/random:35:0,
                 from /usr/include/ignition/math2/ignition/math/Rand.hh:20,
                 from /usr/include/ignition/math2/ignition/math.hh:18,
                 from /usr/include/sdformat-4.0/sdf/Param.hh:34,
                 from /usr/include/sdformat-4.0/sdf/Element.hh:24,
                 from /usr/include/sdformat-4.0/sdf/sdf.hh:5,
                 from /usr/include/gazebo-7/gazebo/common/Battery.hh:25,
                 from /usr/include/gazebo-7/gazebo/common/common.hh:8,
                 from /home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/include/hector_gazebo_plugins/diffdrive_plugin_multi_wheel.h:80,
                 from /home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_multi_wheel.cpp:78:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \

I believe this is a compiler issue, where ROS defaults to C++03 (according to this), so I would like to use C++11 ... (more)

edit retag flag offensive close merge delete

Comments

Hi JB,

were you able to solve this issue?

Hugo Sardinha gravatar imageHugo Sardinha ( 2017-04-19 09:12:16 -0600 )edit

Unfortunately not, if you do please answer this post.

jbourne gravatar imagejbourne ( 2017-04-19 10:24:43 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-04-20 06:24:55 -0600

Hugo Sardinha gravatar image

HI JB,

You can add the following line to your CMakeLists file in you catkin workspace

set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")

A more thorough discussion can be found here: http://answers.ros.org/question/15227...

let me know if that works. It worked for me, and I was able to compile. Cheers, Hugo

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-10-19 20:31:21 -0600

Seen: 245 times

Last updated: Apr 20 '17