I am doing a project for an MSC games course for which we are using Havok and it is my job to integrate it :p. Included all the files we need to use, undefined bits we don't need and written a class to set up everything which i called Physics.h and it can be seen below.
This compiles fine until I try to use it. I make a pointer to the class:
Physics *physics
and then initialise it :
physics = new Physics(true)
and it gives me a list of 27 unresolved external symbols here are the first few:
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall hkpWorldCinfo::hkpWorldCinfo(void)" (??0hkpWorldCinfo@@QAE@XZ) referenced in function "public: __thiscall Physics::Physics(bool)" (??0Physics@@QAE@_N@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual class hkClass const * __thiscall hkReferencedObject::getClassType(void)const " (?getClassType@hkReferencedObject@@UBEPBVhkClass@@XZ)
1>main.obj : error LNK2001: unresolved external symbol "protected: static class hkThreadLocalData<class hkMemoryRouter *> hkMemoryRouter::s_memoryRouter" (?s_memoryRouter@hkMemoryRouter@@1V?$hkThreadLocalData@PAVhkMemoryRouter@@@@A)
1>main.obj : error LNK2001: unresolved external symbol "protected: static class hkMemoryTracker * hkMemoryTracker::s_singleton" (?s_singleton@hkMemoryTracker@@1PAV1@A)
1>main.obj : error LNK2019: unresolved external symbol "public: void __cdecl hkMonitorStream::resize(int)" (?resize@hkMonitorStream@@QAAXH@Z) referenced in function "private: void __thiscall Physics::initMemory(void)" (?initMemory@Physics@@AAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall hkCpuJobThreadPoolCinfo::hkCpuJobThreadPoolCinfo(void)" (??0hkCpuJobThreadPoolCinfo@@QAE@XZ) referenced in function "private: void __thiscall Physics::initMemory(void)" (?initMemory@Physics@@AAEXXZ)
Has anyone got any idea what is going on here I am not getting anywhere....
<nolyc> Undefined reference is a linker error.
It's not a compile error. #includes don't help.
You did not define the thing in the error message, you forgot to link the file that defines it, you forgot to link to the library that defines it, or, if it's a static library, you have the wrong order on the linker command line.
Check which one. (Note that some linkers call it an unresolved external)