user2966197 user2966197 - 4 months ago 60
C++ Question

erand48(X) not working in C++ , Visual Studio 12

I have C++ code which has a line with

in few lines and Visual Studio gives
Unable to identify
error on this. I searched online and found out that
does not exist in Visual Studio (or in Windows). Suggestions were to write the implementation by oneself. Can anyone provide me the implementation for this as I am new to this and I am short at time to give too much of time to this.

Also there are few line which starts with
uniform sampler2D Texture
and it gives error as
the value or constructor 'uniform' not defined
. Why is it showing this error and how to remove this?


Use uniform_real_distribution Class as instead.

#include <random>
#include <iostream>
std:: default_random_engine generator;
std::uniform_real_distribution<double> distr(0.0,1.0);
double erand48(int X){
    return distr(generator);

int main(){
    std::cout << erand48(1) << std::endl;
    return 0;

or just use LibGW32C for windows