【DEVc++】下如何实现c++多线程

在使用DEVc++编译多线程程序时会出现以下报错:

#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.

因为c++多线程是c11新定义的,编译器要支持2011标准才可以,从编译器那里加上-std=c++11 or -std=gnu++11就可以了

这里可以直接在dev里面设置:

(1)打开工具——编译选项

(2)编译时加入以下命令:-std=c++11 或者 -std=gnu++11

(3)确定之后就可以正常运行了

猜你喜欢

转载自blog.csdn.net/weixin_52336311/article/details/134151890