しかしエラーが出てきて困っています
使おうとしている変数が定義されていないらしいのですがよくわかりません
どうかよろしくお願いします
1>test.obj : error LNK2019: 未解決の外部シンボル "void __cdecl Key_test(void)" (?Key_test@@YAXXZ) が関数 _WinMain@16 で参照されました。
1>C:\~~\GameProg\Debug\GameProg.exe : fatal error LNK1120: 外部参照 1 が未解決です。
test.cpp
#include "DxLib.h"
#include "Player.h"
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){
//ウィンドウモード変更と初期化と裏画面設定
ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen( DX_SCREEN_BACK );
while( ScreenFlip() == 0 && ProcessMessage() == 0 && ClearDrawScreen() == 0 ){
Key_test();
//ここに処理を追加
}
DxLib_End(); // DXライブラリ終了処理
return 0;
}
#include "DxLib.h"
static int m_Key[256]; // キーの入力状態格納変数
// キーの入力状態更新
void Keyboard_Update(){
char tmpKey[256]; // 現在のキーの入力状態を格納する
GetHitKeyStateAll( tmpKey ); // 全てのキーの入力状態を得る
for( int i=0; i<256; i++ ){
if( tmpKey[i] != 0 ){ // 1番のキーコードに対応するキーが押されたら
m_Key[i]++; // 加算
} else { // 押されていなければ
m_Key[i] = 0; // 0にする
}
}
}
// KeyCodeのキーの入力状態を取得する
int Keyboard_Get( int KeyCode ){
return m_Key[ KeyCode ]; // KeyCodeの入力状態を返す
}
#ifndef DEF_KEYBOARD_H // 二重include防止
#define DEF_KEYBOARD_H
// キーの入力状態を更新する
void Keyboard_Update();
// 引数のキーコードのキーの入力状態を返す
int Keyboard_Get( int KeyCode );
#endif
#include "Keyboard.h"
void key_test(){
if( Keyboard_Get( KEY_INPUT_UP ) > 0 ){
DrawFormatString( 100, 100, GetColor(255, 255, 255), "上が押されています" );
}
if( Keyboard_Get( KEY_INPUT_DOWN ) > 0 ){
DrawFormatString( 100, 200, GetColor(255, 255, 255), "下が押されています" );
}
}