シングルトンパターンで作っているのですが、コンパイルは通るのですが、
リンクができません。
どこがまずいのでしょうか?
以下がソースです。
[CPlayer.h]
#pragma once
class CPlayer
{
double m_x;
double m_y;
double m_hp;
static CPlayer* _instance;
public:
static CPlayer* GetInstance();
CPlayer();
~CPlayer();
void Init();
void Draw();
void Move();
};
#include "stdafx.h"
CPlayer::CPlayer()
{
_instance = NULL;
}
CPlayer::~CPlayer()
{
}
CPlayer* CPlayer::GetInstance()
{
if (_instance == NULL)
_instance = new CPlayer();
return _instance;
}
void CPlayer::Init()
{
m_x = 320;
m_y = 480;
m_hp = 1000;
}
void CPlayer::Draw()
{
DrawBox((int)m_x - 8, (int)m_y - 8, (int)m_x + 8, (int)m_y + 8, GetColor(0, 255, 0), true);
}
void CPlayer::Move()
{
}
#pragma once
#include "stdafx.h"
#define INIT_FILE "setting.txt"
int dic_Init();
#define FLAME 30
void fps_wait();
void draw_fps(int x, int y);
class CSystemData
{
static CSystemData* _instance;
public:
static CSystemData* GetInstance();
CSystemData();
~CSystemData();
void Init();
};
CSystemData::CSystemData()
{
}
CSystemData::~CSystemData()
{
}
CSystemData* CSystemData::GetInstance()
{
if (_instance == NULL)
_instance = new CSystemData();
return _instance;
}
void CSystemData::Init()
{
}
重大度レベル コード 説明 プロジェクト ファイル 行 抑制状態
エラー LNK1120 2 件の未解決の外部参照 DxLib_2 C:\Users\user\Documents\Visual Studio 2017\source\DxLib_2\Debug\DxLib_2.exe 1