I have this code in a .h file in a project in Eclipse IDE.
#include <cstdlib>
#include <stdint.h>
#include <random> // this is its header
std::mt19937 rng(time(NULL)); // mersenne numbers
int random(int n) {
std::uniform_int_distribution<int> distribution(0, n);
return distribution(rng);
}
However, Eclipse says that it can't resolve that symbol. It can run the code though. The problem is that it leaves the file marked with a red x, indicating error, which makes it a bit ugly when debugging, since I have many files in my project.
How do get rid of this Eclipse weakness?