I'm using Visual Studio 2015 Update 2. I have two headers called Error.h and Game.h.
Error.h:
#ifndef _Error_H
#define _Error_H
#include "Main.h"
#include "Core.h"
#include <Log.h>
#include <CWindows.h>
// ErrorIDs
enum
{
ErrUnknownID = 0,
blah,
blah2,
blah3
};
struct ErrInfo
{
unsigned int eiID;
String strCaption; // String is another class which implemented from std::string which works fine!
String strText;
bool bFixable = false;
};
// Static errors
extern ErrInfo WinNotSupported;
// blah blah
class Error
{
public:
void Initialize();
bool ShowError(ErrInfo ErrorInfo);
BOOL FixError(unsigned int uiErrorID);
// -----------------------------------------
// --------------- Singleton ---------------
// -----------------------------------------
public:
static Error& Instance()
{
static Error instance;
return instance;
}
static Error *InstancePtr()
{
return &Instance();
}
private:
Error()
{
}
public:
Error(Error const&) = delete;
void operator=(Error const&) = delete;
};
#endif // !_Error_H
And Game.h:
#ifndef _Game_H
#define _Game_H
#include "Main.h"
#include "Error.h"
#include "Core.h"
#include <CWindows.h>
#include <AFile.h>
struct missingfileSt
{
String strFileURL;
String strDLFileName;
String strFileName;
String strChecksum;
long long llSize;
ErrInfo errError; // Many errors here <-
};
struct deletablefileSt
{
String strFileName;
ErrInfo errError; // Many errors here too
};
#define siMissingFiles 7
#define siDeletableFiles 5
class Game
{
public:
void ValidateFiles();
DWORD dwGamePID;
missingfileSt mfMissingFiles[siMissingFiles];
deletablefileSt dfDeletableFiles[siDeletableFiles];
// -----------------------------------------
// --------------- Singleton ---------------
// -----------------------------------------
public:
static Game& Instance()
{
static Game instance;
return instance;
}
static Game *InstancePtr()
{
return &Instance();
}
private:
Game()
{
dwGamePID = 0;
}
public:
Game(Game const&) = delete;
void operator=(Game const&) = delete;
};
#endif // !_Game_H
Now, when I compile I get many errors from Game.h and all of them are:
Error C3646 'errError': unknown override specifier
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int
I got really confused, why errors!? Also I must say, in header Core.h it will include Error.h again but it mustn't be problem!