Including Settings.h into Main.cpp, on compiling, the following errors appear:
class WindowData * windowData" (?windowData@@3PEAVWindowData@@EA) already defined in Main.obj Settings.obj 1
class Time * timeControl" (?timeControl@@3PEAVTime@@EA) already defined in Main.obj Settings.obj 1
class Camera * cam1" (?cam1@@3PEAVCamera@@EA) already defined in Main.obj
Settings.obj 1class InputManager * inputManager" (?inputManager@@3PEAVInputManager@@EA) already defined in Main.obj
Settings.obj 1class ShaderManager * shaderManager" (?shaderManager@@3PEAVShaderManager@@EA) already defined in Main.obj
Settings.obj 1one or more multiply defined symbols found MORPH_Client.exe 1
Settings.h
#pragma once
#include "WindowData.h"
#include "Time.h"
#include "Camera.h"
#include "ShaderManager.h"
#include "InputManager.h"
WindowData* windowData;
Time* timeControl;
Camera* cam1;
InputManager* inputManager;
ShaderManager* shaderManager;
Settings.cpp
#include "Settings.h"
Main.cpp
#include "Settings.h"
int main()
{
return 0;
}
Can someone explain to me what I may be doing wrong?
Settings.h is meant to be a sort of header for the main file, where some OpenGL functions are executed for startup. This is the best way I could set this up that I could think of, since some of OpenGL's event informing functions require callback functions that can't be class methods. I would have encapsulated everything in a single SetupClass if it wheren't for that, and I couldn't really figure any other code structure.
I'm watching over this help request, so if more info is needed I'll add it immediately.