The title might be unclear but the code is simple and should explain itself. I would like to typedef a constructor to my class inside the class and then set the address of said constructor elsewhere.
class Dog {
public:
typedef Dog* (__thiscall* Constructor_T)(Dog* thisptr);
static Constructor_T Constructor;
Dog() {
Constructor(this);
}
};
void SetDogConstructor() {
Dog::Constructor = (Dog::Constructor_T)0x1234;
}
The error I receive is:
Error 2 error LNK2001: unresolved external symbol "public: static class Dog * (__thiscall* Dog::Constructor)(class Dog *)" (?Constructor@Dog@@2P6EPAV1@PAV1@@ZA)