jeudi 22 avril 2021

Can't use random number generator in c++

I have searched if anyone had the same problem but I havent found anything. This is my piece of code:

#ifndef GAME__2_RANDOM_H
#define GAME__2_RANDOM_H


#include <random>
#include <chrono>

class Random {
    std::random_device dev;
    std::mt19937 rng(dev());
    std::uniform_int_distribution<std::mt19937::result_type> dist(1,6);
};


#endif //GAME__2_RANDOM_H

I'm getting these 2 errors:

First error

Second error

My IDE is clion with Visual studio compiler as you can see here:

Visual studio compiler picture

What's wrong and why it is not working?




Aucun commentaire:

Enregistrer un commentaire