ad_with_lanelet2 编译问题解决

  1. 缺少的依赖
sudo apt-get install ros-kinetic-manipulation-msgs
sudo apt-get install ros-kinetic-uuid-msgs 
sudo apt-get install ros-kinetic-tf2-geometry-msgs 
sudo apt-get install ros-kinetic-unique-id

还会提示缺少 mrt_cmake_modules,下载链接:mrt_cmake_modules

下载完后放到 common

  1. 编译遇到的问题
In file included from /usr/include/boost/config.hpp:61:0,
                 from /usr/include/boost/math/tools/config.hpp:13,
                 from /usr/include/boost/math/special_functions/round.hpp:13,
                 from /opt/ros/kinetic/include/ros/time.h:58,
                 from /opt/ros/kinetic/include/ros/ros.h:38,
                 from /home/seivl/hd_ws/src/ad_with_lanelet2/planning/mission_planning/mission_planner/include/mission_planner/lanelet2_impl/mission_planner_lanelet2.h:21,
                 from /home/seivl/hd_ws/src/ad_with_lanelet2/planning/mission_planning/mission_planner/src/mission_planner_lanelet2/mission_planner_lanelet2.cpp:17:
/usr/include/boost/math/constants/constants.hpp: In static member function ‘static constexpr T boost::math::constants::detail::constant_half<T>::get(const mpl_::int_<5>&):
/usr/include/boost/math/constants/constants.hpp:277:3: error: unable to find numeric literal operatoroperator""Q’
   BOOST_DEFINE_MATH_CONSTANT(half, 5.000000000000000000000000000000000000e-01, "5.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-01")
   ^
/usr/include/boost/math/constants/constants.hpp:277:3: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
/usr/include/boost/math/constants/constants.hpp: In static member function ‘static constexpr T boost::math::constants::detail::constant_third<T>::get(const mpl_::int_<5>&):
/usr/include/boost/math/constants/constants.hpp:278:3: error: unable to find numeric literal operatoroperator""Q’
   BOOST_DEFINE_MATH_CONSTANT(third, 3.333333333333333333333333333333333333e-01, "3.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333e-01")
   ^

修改这些路径下的CMakeLists.txt 文件:

ad_with_lanelet2/map/lanelet2_extension
ad_with_lanelet2/planning/mission_planning/mission_planner
ad_with_lanelet2/map/util/lanelet2_map_preprocessor

加入:

#add_compile_options(-std=c++14)
add_compile_options(-std=c++11) 
#add_compile_options(-std=gnu++11)
add_compile_options(-fext-numeric-literals)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_MATH_DISABLE_FLOAT128")

猜你喜欢

转载自blog.csdn.net/qq_35632833/article/details/112923613
今日推荐