On the site of www.boost.org i have found a way to generate a real random number . I write here the example they offer :
#include <boost/random/random_device.hpp>
#include <iostream>
int main()
{
boost::random::random_device gen;
std::cout << gen() << '\n';
}
I did the download of the last boost library and actually on the directory boost/random there is the file called random_device.hpp . Trying to compile to this 'simple' program with : g++ nameprogram.cpp . I have this error on the terminal:
/home/andrea/boost_1_66_0/boost/random/random_device.hpp:22:28: fatal error: boost/config.hpp: File o directory non esistente compilation terminated. The path in the beginning is right and File o directory non esistente means that they don't exist. What I am doing wrong ? Of course leaving only boost/random/random_device.hpp does not work too.
Aucun commentaire:
Enregistrer un commentaire