In my options class, I declare a static pointer of itself (there are other functions that have been removed to make it easier to read):
class Options {
public:
std::string resourceFolder;
static Options* o;
int GetInt();
std::string GetResourceFolder();
};
After this code, I received an unresolved external error as I had not defined the pointer. So I did that in my cpp file:
#include "Options.h"
Options* Options::o;
However, this should run without a compiler error. But, I receive the following error from the compiler:
fatal error C1001: An internal error has occurred in the compiler.
Is this a bug with the compiler? It also gives me the same error when I do not use a pointer (use a normal object declaration). A similar question can be found here
However the questions solution does not work for me.
EDIT
My compiler is visual studio 2017. I'm pretty sure its a Minimal, Complete, and Verifiable example.