Another C++ template issue, and I have no idea where it is coming from. My only guess is that the template constructor is not synthesized? (Even the term synthesized is from my ObjC background, not great with C++)
All I could do is simplify the code as much as I can, while maintaining the error. Now, if I remove the State
constructor, the error goes away .. But I need some constructors to work with.
State
template<typename T>
class State {
public:
State();
};
#include "State.h"
template<typename T>
State<T>::State()
{}
Match
#include "State.h"
class Match {
public:
State<Match> *currentState;
struct States {
static State<Match> Playing;
};
};
#include "Match.h"
State<Match> Match::States::Playing;
Error
Undefined symbols for architecture x86_64:
"State<Match>::State()", referenced from:
___cxx_global_var_init in Match.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)