リンカ ツール エラー LNK2019とグローバル変数について。
Posted: 2010年1月19日(火) 21:53
今度はリンカ ツール エラー LNK2019とグローバル変数に悩まされています。
どうすればよろしいのでしょうか?
以下問題のソースコードとエラーメッセージ
bitmap.hの中身。
#ifndef BITMAP_GAME
#define BITMAP_GAME
template <class type>
class Graphics
{
public:;
void screen_up();
void mario();
};
class Bitmap
{
protected:
int z;
public:
int get_z();
void change_z(const int& set_z);
};
static Graphics<Bitmap> graphics;
#endif
bitmap.cppの中身
#include "bitmap.h"
template <class type>
void Graphics<type>::screen_up()
{
};
template <class type>
void Graphics<type>::mario()
{
};
int Bitmap::get_z()
{
return z;
};
void Bitmap::change_z(const int& set_z)
{
z=set_z;
};
scene.hの中身
#ifndef SCENE_GAME
#define SCENE_GAME
#include "bitmap.h"
class Scene_Base
{
public:
virtual void main();
};
#endif
scene.cppの中身
#include "scene.h"
void Scene_Base::main()
{
graphics.screen_up();
graphics.mario();
};
どうすればよろしいのでしょうか?
以下問題のソースコードとエラーメッセージ
bitmap.hの中身。
#ifndef BITMAP_GAME
#define BITMAP_GAME
template <class type>
class Graphics
{
public:;
void screen_up();
void mario();
};
class Bitmap
{
protected:
int z;
public:
int get_z();
void change_z(const int& set_z);
};
static Graphics<Bitmap> graphics;
#endif
bitmap.cppの中身
#include "bitmap.h"
template <class type>
void Graphics<type>::screen_up()
{
};
template <class type>
void Graphics<type>::mario()
{
};
int Bitmap::get_z()
{
return z;
};
void Bitmap::change_z(const int& set_z)
{
z=set_z;
};
scene.hの中身
#ifndef SCENE_GAME
#define SCENE_GAME
#include "bitmap.h"
class Scene_Base
{
public:
virtual void main();
};
#endif
scene.cppの中身
#include "scene.h"
void Scene_Base::main()
{
graphics.screen_up();
graphics.mario();
};