用vscode编写ROS程序,写到了thread线程相关内容,编译的时候报错:
error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support
提示需要C++11标准进行编译。
解决方式:
在功能包所在的CMakeListst.txt中,添加add_compile_options(-std=c++11),其实在CMakeLists.txt文件中的第5行已经有了,只不过需要把注释打开。



