c++ - std random functions not working - Qt MinGw -
i using qtcreator 2.4.1, qtsdk 4.8.1 , mingw 4.7.2
i trying utilize (c++11) random library, far have been unsuccesful. take next sample code:
#include <random> ... std::default_random_engine generator; std::uniform_int_distribution<int> distribution(1,6); int dice_roll = distribution(generator); // generates number in range 1..6
the compiler complains:
error: 'default_random_engine' not fellow member of 'std'
error: 'uniform_int_distribution' not fellow member of 'std'
i've got -std=c++0x flag in .pro file. other stl functionality seems work properly, i'm puzzled! i'd grateful if give me hand this.
well, silly problem, might happen others, here go:
for reason code beingness compiled mingw 4.4, version shipped default qt creator. bring mingw 4.7.2, had installed in computer, clicked on 'projects' tab on left of qcreator screen, selected right tool chain.
thanks loads joachim pileborg pointing me in right direction.
c++ qt random stl mingw
No comments:
Post a Comment