欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ROS下编译报错

程序员文章站 2022-07-14 22:19:30
...

创建answer功能包,里面有一个answer节点,编译报错

 

ROS下编译报错

使用catkin_make命令进行编译,报错

ROS下编译报错

 

解决方案:在answer功能包下的CMakeList.txt文件中添加

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

则编译通过

 

参考:error This file requires compiler and library support for the ISO C++ 2011 standard.

 

error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

当使用CMAKE编译工程时,出现这个错误,解决办法:
在工程主目录的CMakeLists.txt中添加如下,可以编译成功:

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