I've got this "global" library for my project, which will include all the standard includes and define all the "project-wide" globals, but I have a problem: when I try to add a global variable in, VC++, and I include the globals library in more than one file, I get this "globals redefined". Here is my code:
#ifndef __GLOBALS__
#define __GLOBALS__
#include "DarkGDK.h"
#include "d3dfunc.h"
#define SWIDTH 600
#define SHEIGHT 600
#define SDEPTH 32
struct Globals
{
bool end;
} globals;
#endif
I've also tried
#pragma once
, but that didn't work either. How to I declare these globals?