BootCamp2019 icon indicating copy to clipboard operation
BootCamp2019 copied to clipboard

Draw random numbers in C++

Open tpellet opened this issue 6 years ago • 2 comments

I am having troubles using the "random" package in C++ to draw random numbers (for Monte Carlo). I get the following error message:

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

and "error: 'default_random_engine' is not a member of 'std'"

tpellet avatar Jul 20 '19 20:07 tpellet

I think you need to add a new parameter when compiling, try:

g++ -std=c++11 <file.cpp> -o <file.exec>

ozaltun avatar Jul 20 '19 20:07 ozaltun

Thank you, It works now!

tpellet avatar Jul 20 '19 21:07 tpellet