0
$\begingroup$

Rosanswers logo

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 standard to compile this package, but I am not sure how to change this using catkin_make. Anybody have an idea of how to do this or get pass this error?

I have also tried this but still no luck, I have these errors:

[  4%] Building CXX object hector_gazebo/hector_gazebo_plugins/CMakeFiles/hector_gazebo_ros_magnetic.dir/src/gazebo_ros_magnetic.cpp.o
/home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_6w.cpp: In member function ‘virtual void gazebo::DiffDrivePlugin6W::Update()’:
/home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_6w.cpp:231:25: error: ‘class gazebo::physics::Joint’ has no member named ‘SetMaxForce’
     joints[FRONT_LEFT]->SetMaxForce(0, torque);
                         ^
/home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_6w.cpp:232:23: error: ‘class gazebo::physics::Joint’ has no member named ‘SetMaxForce’
     joints[MID_LEFT]->SetMaxForce(0, torque);
                       ^
/home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_6w.cpp:233:24: error: ‘class gazebo::physics::Joint’ has no member named ‘SetMaxForce’
     joints[REAR_LEFT]->SetMaxForce(0, torque);
                        ^
/home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_6w.cpp:235:26: error: ‘class gazebo::physics::Joint’ has no member named ‘SetMaxForce’
     joints[FRONT_RIGHT]->SetMaxForce(0, torque);
                          ^
/home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_6w.cpp:236:24: error: ‘class gazebo::physics::Joint’ has no member named ‘SetMaxForce’
     joints[MID_RIGHT]->SetMaxForce(0, torque);
                        ^
/home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_6w.cpp:237:25: error: ‘class gazebo::physics::Joint’ has no member named ‘SetMaxForce’
     joints[REAR_RIGHT]->SetMaxForce(0, torque);
                         ^
/home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_multi_wheel.cpp: In member function ‘virtual void gazebo::GazeboRosDiffDriveMultiWheel::Load(gazebo::physics::ModelPtr, sdf::ElementPtr)’:
/home/jbourne/hector_quadrotor_tutorial/src/hector_gazebo/hector_gazebo_plugins/src/diffdrive_plugin_multi_wheel.cpp:250:27: error: ‘class gazebo::physics::Joint’ has no member named ‘SetMaxForce’
         joints_[side][i]->SetMaxForce(0, torque);
                           ^
hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_6w.dir/build.make:62: recipe for target 'hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_6w.dir/src/diffdrive_plugin_6w.cpp.o' failed
make[2]: *** [hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_6w.dir/src/diffdrive_plugin_6w.cpp.o] Error 1
CMakeFiles/Makefile2:5541: recipe for target 'hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_6w.dir/all' failed
make[1]: *** [hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_6w.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_multi_wheel.dir/build.make:62: recipe for target 'hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_multi_wheel.dir/src/diffdrive_plugin_multi_wheel.cpp.o' failed
make[2]: *** [hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_multi_wheel.dir/src/diffdrive_plugin_multi_wheel.cpp.o] Error 1
CMakeFiles/Makefile2:6567: recipe for target 'hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_multi_wheel.dir/all' failed
make[1]: *** [hector_gazebo/hector_gazebo_plugins/CMakeFiles/diffdrive_plugin_multi_wheel.dir/all] Error 2
[  5%] Linking CXX shared library /home/jbourne/hector_quadrotor_tutorial/devel/lib/libgazebo_ros_force_based_move.so
[  5%] Built target gazebo_ros_force_based_move
[  5%] Linking CXX shared library /home/jbourne/hector_quadrotor_tutorial/devel/lib/libhector_gazebo_ros_magnetic.so
[  5%] Built target hector_gazebo_ros_magnetic
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4" failed

thanks,

JB


Originally posted by jbourne on ROS Answers with karma: 53 on 2016-10-19

Post score: 1


Original comments

Comment by Hugo Sardinha on 2017-04-19:
Hi JB,

were you able to solve this issue?

Comment by jbourne on 2017-04-19:
Unfortunately not, if you do please answer this post.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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/152276/is-there-a-way-to-enable-c11-support-for-catkin-packages/

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


Originally posted by Hugo Sardinha with karma: 28 on 2017-04-20

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.