2015-02-18 1 views
1

Я пытался скомпилировать узел, который использует библиотеку, которая нуждается в флагом 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++, но я не знаю, что делать, чтобы исправить это. Кто-нибудь может мне помочь?

Спасибо заранее

ответ

1

Я успешно использовал следующую строку в моем файле CMakeLists.txt:

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

Это не решает проблему. Я использую 'rosbuild_add_compile_flags (command_uav_node "-std = C++ 11")', который имеет тот же эффект. Ошибка пришла от . Может быть, потому, что я использую ROS fuerte, и он может быть скомпилирован без флагов C++ 11? – Bardo91

+2

@ Bardo91: Какой компилятор вы используете? Для более старых версий GCC (<= 4.6) это '-std = C++ 0x'. – luator

+0

Я установил gcc-4.8. Если вы спросите, какой компилятор использует «rosmake», я не знаю. Я компилирую с помощью rosmake, что касается использования файла CmakeList (в каком файле я устанавливаю флаг) в качестве конфигурации и использования gcc-компилятора компьютера (это должно быть gcc-4.8). – Bardo91

 Смежные вопросы

  • Нет связанных вопросов^_^