Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw random numbers in C++ #31

Open
tpellet opened this issue Jul 20, 2019 · 2 comments
Open

Draw random numbers in C++ #31

tpellet opened this issue Jul 20, 2019 · 2 comments

Comments

@tpellet
Copy link

tpellet commented Jul 20, 2019

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

@ozaltun
Copy link

ozaltun commented Jul 20, 2019

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

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

@tpellet
Copy link
Author

tpellet commented Jul 20, 2019

Thank you, It works now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants