こちらのソースをベタ張りして、
DXライブラリをincludeし、あわよくばこれでゲームをつくろうと思ったのですが、あまり見かけないエラーがでました。
どのようなエラーで、どうすれば解決できるのでしょうか?
1>リンクしています...
1>main.obj : error LNK2001: 外部シンボル ""int __cdecl DxLib_Init(void)" (?DxLib_Init@@YAHXZ)" は未解決です。
1>main.obj : error LNK2001: 外部シンボル ""int __cdecl GetHitKeyStateAll(char *)" (?GetHitKeyStateAll@@YAHPAD@Z)" は未解決です。
1>main.obj : error LNK2001: 外部シンボル ""int __cdecl SetDrawScreen(int)" (?SetDrawScreen@@YAHH@Z)" は未解決です。
1>main.obj : error LNK2001: 外部シンボル ""int __cdecl ChangeWindowMode(int)" (?ChangeWindowMode@@YAHH@Z)" は未解決です。
1>main.obj : error LNK2001: 外部シンボル ""int __cdecl ScreenFlip(void)" (?ScreenFlip@@YAHXZ)" は未解決です。
1>main.obj : error LNK2001: 外部シンボル ""int __cdecl ClearDrawScreen(void)" (?ClearDrawScreen@@YAHXZ)" は未解決です。
1>main.obj : error LNK2001: 外部シンボル ""int __cdecl ProcessMessage(void)" (?ProcessMessage@@YAHXZ)" は未解決です。
1>main.obj : error LNK2001: 外部シンボル ""int __cdecl DxLib_End(void)" (?DxLib_End@@YAHXZ)" は未解決です。
1>C:\Documents and Settings\sood\My Documents\Visual Studio 2008\Projects\テスト\Release\テスト.exe : fatal error LNK1120: 外部参照 8 が未解決です。
DxDirectX.h(本編からコピーしたもの)
DxLib.h(本編からコピーしたもの)
GV.h
#include "include/DxLib.h"
#ifdef GLOBAL_INSTANCE
#define GLOBAL
#else
#define GLOBAL extern
#endif
#define GLOBAL_INSTANCE
#include "GV.h"
int Key[256];
int GetHitKeyStateAll_2(int GetHitKeyStateAll_InputKey[]){
char GetHitKeyStateAll_Key[256];
GetHitKeyStateAll( GetHitKeyStateAll_Key );
for(int i=0;i<256;i++){
if(GetHitKeyStateAll_Key[i]==1) GetHitKeyStateAll_InputKey[i]++;
else GetHitKeyStateAll_InputKey[i]=0;
}
return 0;
}
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ){
ChangeWindowMode(TRUE);//ウィンドウモード
if(DxLib_Init() == -1 || SetDrawScreen( DX_SCREEN_BACK )!=0) return -1;//初期化と裏画面化
while(ProcessMessage()==0 && ClearDrawScreen()==0 && GetHitKeyStateAll_2(Key)==0 && Key[KEY_INPUT_ESCAPE]==0){
//↑メッセージ処理 ↑画面をクリア ↑入力状態を保存 ↑ESCが押されていない
//ココ!!
ScreenFlip();
}
DxLib_End();
return 0;
}
http://dixq.net/rp/5.html
の#記号にはどのような意味が含まれてるのでしょうか?
どういう状態になるのでしょうか?
解説を見て、「if文の略称で、GLOBALという文字が空白やexternに入れ替わるんだな」と思うんですが・・・