プログラムを書いたのですが、実行しようとすると以下の二つのエラーが出て実行できません
エラー番号を検索するなどして努力したのですが、自力で直すことは叶いませんでした
そこで、どうか①「原因となっている箇所」、②「その箇所の正しい記述」、③「エラーの見方」の三つを教えてください
環境は以下の通りです
OS : windows8.1
IDE : Visual Studio 2017 Community
ライブラリ : DXライブラリ
▼-----エラー内容-----▼
エラー LNK2019 未解決の外部シンボル "void __cdecl fSHOT1(int *,int *,int,int,int,int)" (?fSHOT1@@YAXPAH0HHHH@Z) が関数 _WinMain@16 で参照されました。 testProject D:\MyProgram\testProg\testProject\playerShotStraight.obj 1
エラー LNK1120 1 件の未解決の外部参照 testProject D:\MyProgram\testProg\testProject\Debug\testProject.exe 1
▲-----エラー内容-----▲
#include "DxLib.h"
#define _USE_MATH_DEFINES
#include<math.h>
//変数定義
int windowWidth = 1920, windowHeight = 1080;//ウインドウの縦横サイズ
struct battleman { int x, y, speed; };
struct shot { int x, y; };
//関数プロトタイプ宣言
void fPLAYERMOVE(int *x, int *y, int, int, int);
void fSHOT1(int *shotx, int *shoty, int, int, int, int);
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
SetOutApplicationLogValidFlag(false), DxLib_Init(), SetDrawScreen(DX_SCREEN_BACK), SetGraphMode(windowWidth, windowHeight, 32);
SetWindowText("playerShotStraight");//ウインドウタイトル設定
//構造体系
struct battleman player = { 0,0,20 };
struct shot shot1[10];
for (int i = 0; i < 10; i++) {
shot1[i].x = 0;
shot1[i].y = 0;
}
//メインループ
while (!ScreenFlip() && !ProcessMessage() && !ClearDrawScreen()) {
//自機移動
fPLAYERMOVE(&player.x, &player.y, player.speed, windowWidth, windowHeight);
DrawString(player.x, player.y, "PLAYER", GetColor(64, 64, 255));
SetMouseDispFlag(true);//マウスカーソルを描画
//直進弾発射
fSHOT1(&shot1[10].x, &shot1[10].y, player.x, player.y, windowWidth, windowHeight);
DrawString(shot1[10].x, shot1[10].y, "SHOT1", GetColor(255, 255, 255));
}
DxLib_End();
return 0;
}
//関数定義
void fPLAYERMOVE(int *x, int *y, int speed, int width, int height) {
if (CheckHitKey(KEY_INPUT_W)) {
*y -= speed;
if (*y <= 0)*y = 0;
}
if (CheckHitKey(KEY_INPUT_A)) {
*x -= speed;
if (*x <= 0)*x = 0;
}
if (CheckHitKey(KEY_INPUT_S)) {
*y += speed;
if (*y >= height)*y = height;
}
if (CheckHitKey(KEY_INPUT_D)) {
*x += speed;
if (*x >= width)*x = width;
}
}
void fSHOT1(int *shotx[10], int *shoty[10], int px, int py, int width, int height) {
int count = 0, agility = 20, speed = 20;
int nowmx = 0, nowmy = 0, se = LoadSoundMem("shot1.ogg");
float angle;
struct iseries { int tax, tay, bux, buy, flag, velx, vely; };
struct iseries shot[10];
for (int i = 0; i < 10; i++) {
shot[i].tax = 0;
shot[i].tay = 0;
shot[i].bux = 0;
shot[i].buy = 0;
shot[i].flag = 0;
shot[i].velx = 0;
shot[i].vely = 0;
}
if (count < agility) {
count++;
} else if (GetMouseInput()&MOUSE_INPUT_1) {
PlaySoundMem(se, DX_PLAYTYPE_BACK);
count = 0;
GetMousePoint(&nowmx, &nowmy);
for (int i = 0; i < 10; i++) {
if (shot[i].flag == 0) {
shot[i].flag = 1;
shot[i].bux = px;
shot[i].buy = py;
shot[i].tax = nowmx;
shot[i].tay = nowmy;
angle = atan2f((float)shot[i].tay - (float)shot[i].bux, (float)shot[i].tax - (float)shot[i].bux);
shot[i].velx = (int)cosf(angle) * speed;
shot[i].vely = (int)sinf(angle) * speed;
break;
}
}
}
for (int i = 0; i < 10; i++) {
if (shot[i].flag == 1) {
*shotx += shot[i].velx;
*shoty += shot[i].vely;
if (shot[i].bux<0 || shot[i].buy<0 || shot[i].bux>width || shot[i].buy>height) {
shot[i].flag = 0;
}
}
}
}