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:
#include <random>
#include <iostream>
That error means a failure to open the file "/dev/urandom". My guess is that such a device is not supported under MinGW. If there is in fact a valid hardware entropy source available in Windows and presented as a file node, pass the name of that to the std::random_device constructor, otherwise you will not be able to use the hardware entropy source feature of the standard library.
You could, instead, use good old std::time() to initialize your PRNG engine. It's pretty portable and good enough for non-cryptographic purposes.
Stephen M. Webb
Professional Free Software Developer