解决C++Random.h(随机数函数库)编译不通过问题

时间:2024-10-14 14:08:24

、最近小编在编程的时候,发现报出了一稍僚敉视个错误。追根到底,竟是随机数函数库Random.h(Random)内发生了错误。内容如下:c:\program files\dev-cpp\mi荏鱿胫协ngw64\lib\gcc\x86_64-w64-mingw32\4.7.1\include\c++\bits\c++0x_warning.h [Error] #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.

Dev-C++

1、打开DEV-C++界面

2、点击“工具”菜单>>"编译选项"按钮英文版:"Tools"菜单>>"Compiler Options"

3、把"编译时加入以下命令"打钩英文版:"Add the following commands when calling the compiliner"

4、在"编译时加入以下命令(英文版:Add the following commands when calling t茑霁酌绡he compiliner)"下面的编辑框里输入:-std=c++11

5、点击"确定(英文版:OK)"

Linux(G++)

1、在编译命令后加入:-std=c++11;

© 手抄报圈