Original Post
Some time ago i have downloaded CodeBlocks with Ming32 package, since it has outdated g++ version i have downloaded it separately (4.6.2) and changed compiler/linker paths acordingly, and also added new PATH path into environment variables to Mingw/bin.
Then recently tried some example code from cppreference:
and it crashed:
Then recently tried some example code from cppreference:
#include <random>
#include <iostream>
int main()
{
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> dis(1, 6);
for(int n=0; n<10; ++n)
std::cout << dis(gen) << ' ';
std::cout << '\n';
return 0;
}
and it crashed:
terminate called after throwing an instance of 'std::runtime_error'
what(): random_device::random_device(const std::string&)
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
[/quote]
Got same message if i compile it from command line its same as from IDE.
Tried it on VS 2010 it works, tried it on Ubuntu 11.10 g++ 4.6.2 thru Virtual machine also works.
Any idea?