以下に示すように、ヘッダーファイル内で通常のエラーが発生しています。
Error 54 error C3083: 'Resources': the symbol to the left of a '::' must be a type e:\users\nkosi\documents\visual studio 2010\projects\directx games\direct2d\dx2dhelper\dx2dhelper\sprite.h 28 1 DX2DHelper
Error 55 error C2039: 'DX2DImage' : is not a member of 'DX2DHelper' e:\users\nkosi\documents\visual studio 2010\projects\directx games\direct2d\dx2dhelper\dx2dhelper\sprite.h 28 1 DX2DHelper
Error 56 error C2061: syntax error : identifier 'DX2DImage' e:\users\nkosi\documents\visual studio 2010\projects\directx games\direct2d\dx2dhelper\dx2dhelper\sprite.h 28 1 DX2DHelper
Error 57 error C3083: 'Resources': the symbol to the left of a '::' must be a type e:\users\nkosi\documents\visual studio 2010\projects\directx games\direct2d\dx2dhelper\dx2dhelper\sprite.h 32 1 DX2DHelper
Error 58 error C2039: 'DX2DImage' : is not a member of 'DX2DHelper' e:\users\nkosi\documents\visual studio 2010\projects\directx games\direct2d\dx2dhelper\dx2dhelper\sprite.h 32 1 DX2DHelper
Error 59 error C2143: syntax error : missing ';' before '*' e:\users\nkosi\documents\visual studio 2010\projects\directx games\direct2d\dx2dhelper\dx2dhelper\sprite.h 32 1 DX2DHelper
Error 60 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\users\nkosi\documents\visual studio 2010\projects\directx games\direct2d\dx2dhelper\dx2dhelper\sprite.h 32 1 DX2DHelper
Error 61 error C2061: syntax error : identifier 'GameBase' e:\users\nkosi\documents\visual studio 2010\projects\directx games\direct2d\dx2dhelper\dx2dhelper\systemclass.h 30 1 DX2DHelper
しかし、私の一生の間、私は自分が何を間違っているのか理解できません。おそらくセミコロンか何かが欠けていることは知っていますが、それを本当に理解することはできません。すべてのヘッダーファイルは以下のとおりです。
DX2DHelper.h
#include "targetver.h"
#define WIN32_LEAN_AND_MEANheaders
// Windows Header Files:
#include <windows.h>
#include <iostream>
#include <D2D1.h>
#include <D2D1Helper.h>
#include <wincodec.h>
#include <D2DBaseTypes.h>
#include <D2Derr.h>
#define DLEX __declspec(dllexport)
#include "GameBase.h"
#include "SystemClass.h"
#include "DX2DImage.h"
#include "Sprite.h"
SystemClass.h
#ifndef SYSTEMCLASS_H
#define SYSTEMCLASS_H
#include "DX2DHelper.h"
namespace DX2DHelper
{
namespace Core
{
class SystemClass;
struct WindowOptions;
struct DLEX WindowOptions {};
class DLEX SystemClass
{
public:
bool Initialize(WindowOptions options, HINSTANCE hInst);
void Run(GameBase* game, DX2DInitOptions options);
private:
WindowOptions options;
};
}
}
#endif
DX2DImage.h
#ifndef DX2DIMAGE_H
#define DX2DIMAGE_H
#include "DX2DHelper.h"
namespace DX2DHelper
{
namespace Resources
{
class DX2DImage;
class DX2DImageLoader;
class DLEX DX2DImageLoader
{
public:
HRESULT LoadFromFile(char* filePath, DX2DImage* image);
};
class DLEX DX2DImage
{
public:
friend class DX2DImageLoader;
};
}
}
#endif
Sprite.h
#ifndef SPRITE_H
#define SPRITE_H
#include "DX2DHelper.h"
namespace DX2DHelper
{
namespace GameComponents
{
class DLEX Sprite
{
public:
void SetImage(DX2DHelper::Resources::DX2DImage* image);
private:
DX2DHelper::Resources::DX2DImage* image;
};
}
}
#endif
GameBase.h
#ifndef GAMEBASE_H
#define GAMEBASE_H
#include "DX2DHelper.h"
namespace DX2DHelper
{
namespace Core
{
class DLEX GameBase
{
public:
friend class SystemClass;
HRESULT Initialize(HINSTANCE hInst, HWND winHandle, struct DX2DInitOptions options);
};
struct DLEX DX2DInitOptions {};
}
}
#endif
誰かが間違いを理解できれば、私はとても感謝しています。私はおそらく1時間、1時間半近く同じファイルを見てきましたが、修正できません。