Hello again, I seem to have a small problem with my game when it comes to including a definition more than once. I believe the best way to explain it is with the troublesome code...
Game.h
#ifndef _GAME_H_
#define _GAME_H_
//Inlcudes
#include "Echelon.h"
//Game Function Declarations
void GameStart(EchelonEngine* engine);
void GameEnd(EchelonEngine* engine);
void GameStep(EchelonEngine* engine);
void GameRender(EchelonEngine* engine);
//Game objects
Camera cam;
#endif
and now the echelon engine header Echelon.h
//Echelon Game Engine
#include <windows.h>
#include <gl/gl.h>
#include "Camera.h"
#include "Game.h"
#ifndef _ECHELON_H_
#define _ECHELON_H_
//engine class definition OMITTED FOR SPACE
#endif
The error visual studio gives me is... 1>Echelon.obj : error LNK2005: "class Camera cam" (?cam@@3VCamera@@A) already defined in Game.obj
I'm guessing this is a result of Game being included more than once but I thought the #ifndef took care of that.
Whats going on here?
Thank you!
"I would rather be in the boat with a drink on the rocks, than in the drink with a boat on the rocks" -Unknown