c++ - Using std::tr1::normal_distribution in Qt -


i generate numbers normal_distribution in c++11. using qt 4.8 mingw. have added next line

qmake_cxxflags += -std=c++0x

to .pro file , next errors: 'swprintf::' has not been declared 'vswprintf::' has not been declared

tr1 should avoid when using c++11 designed meet limitations of previous standard. (also considered useful went on , became integrated standard.)

luckily there comprehensive random number generation library in c++11 normal distribution.

see here:

http://en.cppreference.com/w/cpp/numeric/random

#include <random> ::: std::random_device rd; std::normal_distribution<double> dist(0,99); std::mt19937 engine(rd()); double a=dist(engine); 

the exact error getting though particular implementation of tr1 isn't anyway. (missing include or missing namespace prefix).


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -