Я пытался скомпилировать узел, который использует библиотеку, которая нуждается в флагом C++ 11 (он использует std :: function и nullptr среди других функций).ROS fuerte rosmake -std = C++ 11 ошибка компиляции
Здесь де 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++, но я не знаю, что делать, чтобы исправить это. Кто-нибудь может мне помочь?
Спасибо заранее
Это не решает проблему. Я использую 'rosbuild_add_compile_flags (command_uav_node "-std = C++ 11")', который имеет тот же эффект. Ошибка пришла от. Может быть, потому, что я использую ROS fuerte, и он может быть скомпилирован без флагов C++ 11? –
Bardo91
@ Bardo91: Какой компилятор вы используете? Для более старых версий GCC (<= 4.6) это '-std = C++ 0x'. – luator
Я установил gcc-4.8. Если вы спросите, какой компилятор использует «rosmake», я не знаю. Я компилирую с помощью rosmake, что касается использования файла CmakeList (в каком файле я устанавливаю флаг) в качестве конфигурации и использования gcc-компилятора компьютера (это должно быть gcc-4.8). – Bardo91