Hello, I'm trying to build a project in VC++ 2008. However, I get the following error:
StaticMeshComponent.cpp
h:\code\parallax\src\staticmeshcomponent.cpp(4) : error C2039: 'GetClassNameA' : is not a member of 'StaticMeshComponent'
Which refers to this line of code [in StaticMeshComponent.cpp]:
[source lang="cpp]
#include "RenderComponents.h"
#include "SDL_opengl.h"
DEFINE_COBJECT_BASE_CLASS(StaticMeshComponent); // Problem :(
...
where DEFINE_COBJECT_BASE_CLASS is #defined in "CObject.h" [StaticMeshComponent derives from CObject] as shown:
#define DEFINE_COBJECT_BASE_CLASS(_Class_) RTTI* _Class_::s_RTTI = new RTTI( #_Class_ , 0 ); CObject* _Class_::Clone() { return new _Class_(*this); } CObject* _Class_::NewObject() { return new _Class_(); } const RTTI* const _Class_::GetType() { return s_RTTI; } const ClassName& _Class_::GetClassName() const { return s_RTTI->TypeName; } bool _Class_::IsA(const RTTI* pRTTI) const { RTTI *pCurRTTI = s_RTTI; while( pCurRTTI ) { if( pRTTI == pCurRTTI ) return true; else pCurRTTI = pCurRTTI->pParent; } check_msg(0, "Should not be here for RTTI check"); return false; }
I don't understand why the compiler is appending the letter 'A' to the function name (i.e. GetClassNameA) when in the directive, it clearly is spelled properly. StaticMeshComponent derives from IRenderComponent (which only has a virtual function: virtual void Render() = 0;) which derives from IComponent (which has 3 pure virtual functions, void Initialize(), void Update(float fTimeDelta), and void Destroy()). I'm using SDL for the project as well. Any ideas? thank you in advance.