【发布时间】:2014-04-05 06:56:42
【问题描述】:
我试图根据离散分布生成随机数并找到此链接:
http://www.cplusplus.com/reference/random/discrete_distribution/
我编译了他们给出的示例并得到了这个错误
C:\Users\Anand\Desktop>g++ random.cpp -o rand
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/random:3
5:0,
from random.cpp:3:
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/c++0x_warning.h:32:2: err
or: #error This file requires compiler and library support for the upcoming ISO
C++ standard, C++0x. This support is currently experimental, and must be enabled
with the -std=c++0x or -std=gnu++0x compiler options.
random.cpp: In function 'int main()':
这表明我需要启用“-std=c++0x”。这可以在 IDE 中轻松完成,但我如何通过 cmd 执行此操作?
【问题讨论】: