I checked a message like this, but the connection was different, the problem was not resolved. The problem with mine is that for some reason the linker expects there to be a definition for the base class, but the base class is just an interface. The following is a general error
c:\users\numerical25\desktop\intro todirectx\godfiles\gxrendermanager\gxrendermanager\gxrendermanager\gxdx.h(2) : error C2504: 'GXRenderer' : base class undefined
Below is the code that shows how the headers connect to each other
GXRenderManager.h
#ifndef GXRM #define GXRM #include <windows.h> #include "GXRenderer.h" #include "GXDX.h" #include "GXGL.h" enum GXDEVICE { DIRECTX, OPENGL }; class GXRenderManager { public: static int Ignite(GXDEVICE); private: static GXRenderer *renderDevice; }; #endif
at the top of the GxRenderManager, there are GXRenderer, windows, GXDX, GXGL headers. I guess by including them all in this document. they are all linked together, as if they were all in the same document. correct me if I am mistaken, as the title of the header. Moving on ...
Gxrenderer.h
class GXRenderer { public: virtual void Render() = 0; virtual void StartUp() = 0; };
Gxgl.h
class GXGL: public GXRenderer { public: void Render(); void StartUp(); };
Gxdx.h
class GXDX: public GXRenderer { public: void Render(); void StartUp(); };
GXGL.cpp and GXDX.cpp respectively
#include "GXGL.h" void GXGL::Render() { } void GXGL::StartUp() { }
Not sure what is going on. I think that how I link documents, I am not sure.
c ++ c visual-studio-2008 visual-c ++ visual-studio
numerical25
source share