error C2504: 'BASECLASS' : base class undefined

Posted by numerical25 on Stack Overflow See other posts from Stack Overflow or by numerical25
Published on 2010-06-16T13:39:11Z Indexed on 2010/06/16 13:42 UTC
Read the original article Hit count: 606

I checked out a post similar to this but the linkage was different the issue was never resolved. The problem with mine is that for some reason the linker is expecting there to be a definition for the base class, but the base class is just a interface. Below is the error in it's entirety

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 link with one another

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 GxRenderManager, there is GXRenderer , windows, GXDX, GXGL headers. I am assuming by including them all in this document. they all link to one another as if they were all in the same document. correct me if I am wrong cause that's how a view headers. 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()
{

}

//...Next document

#include "GXDX.h"


void GXDX::Render()
{

}

void GXDX::StartUp()
{

}

Not sure whats going on. I think its how I am linking the documents, I am not sure.

© Stack Overflow or respective owner

Related posts about c++

Related posts about c