ROS fuerte rosmake -std = c ++ 11编译错误

时间:2015-02-18 20:24:53

标签: c++11 ros

我试图编译一个使用需要c ++ 11标志的库的节点(它在其他功能中使用std :: function和nullptr)。

这是de outpulog:https://www.dropbox.com/s/mr8gltnrdn1 ...

但总结:

               from /usr/include/c++/4.8/bits/stl_algo.h:62,
               from /usr/include/c++/4.8/algorithm:62,
               from /usr/include/boost/math/tools/config.hpp:16,
               from /usr/include/boost/math/special_functions/round.hpp:13,
               from /opt/ros/fuerte/include/ros/time.h:58,
               from /opt/ros/fuerte/include/ros/ros.h:38,
               from /home/bardo91/programming/EC-SAFEMOBIL/ros/PatrollingCV/uav_vision/src/uav_vision_node.cpp:9:
 /usr/include/c++/4.8/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_T1*, _Args&& ...) [with _T1 = actionlib_msgs::GoalStatus_<std::allocator<void> >; _Args = {actionlib_msgs::GoalStatus_<std::allocator<void> >&}]’:
   /usr/include/c++/4.8/bits/stl_uninitialized.h:75:53:   required from ‘static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = actionlib_msgs::GoalStatus_<std::allocator<void> >*; _ForwardIterator = actionlib_msgs::GoalStatus_<std::allocator<void> >*; bool _TrivialValueTypes = false]’

 /usr/include/c++/4.8/bits/stl_uninitialized.h:117:41:   required from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = actionlib_msgs::GoalStatus_<std::allocator<void> >*; _ForwardIterator = actionlib_msgs::GoalStatus_<std::allocator<void> >*]’
  /usr/include/c++/4.8/bits/stl_uninitialized.h:258:63:   required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = actionlib_msgs::GoalStatus_<std::allocator<void> >*; _ForwardIterator = actionlib_msgs::GoalStatus_<std::allocator<void> >*; _Tp = actionlib_msgs::GoalStatus_<std::allocator<void> >]’

等等......这不仅仅是对于库,我想使用c ++的新功能,但我不知道如何解决它。有人能帮助我吗?

提前感谢

1 个答案:

答案 0 :(得分:1)

我在我的CMakeLists.txt文件中成功使用了以下行:

SET(CMAKE_CXX_FLAGS "-std=c++11")