Hello all, i would appreciate it if anyone could enlighten me on a linker error.
First off the error
Code:Error 1 error LNK2019: unresolved external symbol "public: __thiscall ReachTop<class Character>::ReachTop<class Character>(class Character *)" (??0?$ReachTop@VCharacter@@@@QAE@PAVCharacter@@@Z) referenced in function "void __cdecl `dynamic initializer for 'gReachTop''(void)" (??__EgReachTop@@YAXXZ) Main.obj DecisionTest
Reach Top class inherits from Goal Class
Goal Class
ReachTop Class HeaderCode:#ifndef _GOAL_H #define _GOAL_H #include "Action.h" #include <list> template <class T> class Goal { public: Goal(T* pOwner) : mpOwner(pOwner) {} virtual ~Goal() {} virtual float CalculateDesirability() = 0; virtual Action<T>* CreateAction() = 0; protected: T* mpOwner; }; template <class T> struct GoalList { typedef std::list<Goal<T>*> Type; }; #endif
Reachtop class cppCode:#ifndef _REACHTOP_H #define _REACHTOP_H #include <AI.h> #include <SGE.h> using namespace SGE; template <typename T> class ReachTop : public Goal<T> { public: ReachTop<T>(T* pOwner); virtual ~ReachTop() {} virtual float CalculateDesirability(); virtual Action<T>* CreateAction(); protected: T* mpOwner; }; #endif
Code to createCode:#include "ReachTop.h" template <typename T> ReachTop<T>::ReachTop(T* pOwner) : mpOwner(pOwner) { } template <typename T> float ReachTop<T>::CalculateDesirability() { } template <typename T> Action<T>* ReachTop<T>::CreateAction() { }
Any ideas? I can provide the character class and its inheritance aswell if you like.Code:Character* gCharacter = new Character(1, gWorld); Goal<Character>* gReachTop = new ReachTop<Character>(gCharacter);


Reply With Quote
Bookmarks