多分、main.cppが悪いと思うのですがmain.cppのどこが悪いのかがわかりません。
誰か分かる人がいたら教えて下さいお願いします!
あるサイトのリンク
http://www29.atwiki.jp/kokeiro/pages/16.html
エラーメッセージ
1>main.obj : error LNK2019: 未解決の外部シンボル "int blue" (?blue@@3HA) が関数 _WinMain@16 で参照されました。
1>Title.obj : error LNK2001: 外部シンボル ""int blue" (?blue@@3HA)" は未解決です。
1>main.obj : error LNK2001: 外部シンボル ""int * Key" (?Key@@3PAHA)" は未解決です。
1>Title.obj : error LNK2001: 外部シンボル ""int * Key" (?Key@@3PAHA)" は未解決です。
1>main.obj : error LNK2001: 外部シンボル ""int GameState" (?GameState@@3HA)" は未解決です。
1>Title.obj : error LNK2001: 外部シンボル ""int GameState" (?GameState@@3HA)" は未解決です。
1>E:\Visual Studio 2008\Projects\麻雀\Debug\麻雀.exe : fatal error LNK1120: 外部参照 3 が未解決です。
作っているプログラム
main.h
extern int GameState;//ゲームの状態を格納する変数
extern int Key[256];//キーの押下時間を格納する配列
extern int blue;//カラーコードを格納する
int GetKeyInput(int Key[]);//キーの押下時間を調べる関数
//画面切り替え関数
void Title();
void game();
#include "DxLib.h"
#include "main.h"
int WINAPI WinMain( HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ){
ChangeWindowMode( TRUE ) ;
if( DxLib_Init() == -1 )
return -1;
SetDrawScreen( DX_SCREEN_BACK ) ;//裏画面
blue = GetColor(0,0,255);//カラー変更
GameState = 0;//最初に表示する画面
while( ProcessMessage()==0 && GetKeyInput(Key)==0 && Key[KEY_INPUT_ESCAPE]==0 && ClearDrawScreen()==0){//ESCで終了
switch(GameState){
case 0:
Title();
break;
case 1:
game();
break;
}
ScreenFlip();
}
InitGraph();
InitSoundMem();
DxLib_End();//DXライブラリ終了
return 0 ;
}
//キー関連処理
int GetKeyInput(int Key[] ){
char damy[256];
GetHitKeyStateAll(damy);
for(int i=0 ; i<256 ; i++){
if( damy[i] == 1 )
Key[i]++;
else
Key[i]=0;
}
return 0;
}