I am receiving this error
>GXRenderManager.obj : error LNK2001: unresolved external symbol "private: static class GXRenderer * GXRenderManager::renderDevice" (?renderDevice@GXRenderManager@@0PAVGXRenderer@@A)
The following is my code...
GXDX.h
class GXDX: public GXRenderer {
public:
void Render();
void StartUp();
};
GXGL.h
class GXGL: public GXRenderer {
public:
void Render();
void StartUp();
};
GXRenderer
class GXRenderer {
public:
virtual void Render() = 0;
virtual void StartUp() = 0;
};
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
GXRenderManager.cpp
#include "GXRenderManager.h"
int GXRenderManager::Ignite(GXDEVICE DeviceType)
{
switch(DeviceType)
{
case DIRECTX:
GXRenderManager::renderDevice = new GXDX;
return 1;
break;
case OPENGL:
GXRenderManager::renderDevice = new GXGL;
return 1;
break;
default:
return 0;
}
}
main.cpp
#include "GXRenderManager.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
return 0;
}
I am not trying to get it to do anything. I am just trying to compile with no errors. I am new with all this so if anyone can give me a hand. that will be great. thanks