I have an enum as a class member in MyClass
:
.h file:
private:
enum pattern { PAT_ZERO, PAT_SEQ, PAT_PIPE };
static enum pattern pattern;
I use it in a function:
.cpp file:
int MyClass::function(){
switch (pattern) {
case PAT_ZERO:
break;
It compiles, but I get a linker error.
In function `MyClass::function()':
MyClass.cpp:(.text._ZN12MyClass11functionEP6threadPvj+0x120): undefined reference to `MyClass::pattern'
I can't seem to figure out why it's an "undefined reference".