How to use #include <random> with g ++ on Mac?

I am trying to compile a C ++ program that I received from someone else. It was developed on windows and g ++ gives some compilation errors. One of them with

#include <random> 

Which gives the following error: CandidateSolution.cpp:2:18: error: random: No such file or directory . I tried to find where I can get the error.h file, but I can not find it. How can I make this work?

+4
source share
1 answer

This header is new to C ++ 11. Try using -std=c++11 or -std=c++0x . Also, make sure your compiler is up to date.

+7
source

Source: https://habr.com/ru/post/1438294/


All Articles