個人的にはグローバル変数の定義が原因だと考えているのですが、どこが間違っているのかわかりません。
指摘お願いします。
エラーメッセージ
Graph.obj : error LNK2001: 外部シンボル ""int bg" (?bg@@3HA)" は未解決です。
load.obj : error LNK2001: 外部シンボル ""int bg" (?bg@@3HA)" は未解決です。
Graph.obj : error LNK2001: 外部シンボル ""int mero" (?mero@@3HA)" は未解決です。
load.obj : error LNK2001: 外部シンボル ""int mero" (?mero@@3HA)" は未解決です。
Graph.obj : error LNK2001: 外部シンボル ""int Graphcount" (?Graphcount@@3HA)" は未解決です。
Graph.obj : error LNK2001: 外部シンボル ""int notesTest" (?notesTest@@3HA)" は未解決です。
load.obj : error LNK2001: 外部シンボル ""int notesTest" (?notesTest@@3HA)" は未解決です。
load.obj : error LNK2001: 外部シンボル ""int notes" (?notes@@3HA)" は未解決です。
load.obj : error LNK2001: 外部シンボル ""int BGM" (?BGM@@3HA)" は未解決です。
music.obj : error LNK2001: 外部シンボル ""int BGM" (?BGM@@3HA)" は未解決です。
load.obj : error LNK2001: 外部シンボル ""int SE" (?SE@@3HA)" は未解決です。
music.obj : error LNK2001: 外部シンボル ""int SE" (?SE@@3HA)" は未解決です。
以下コード
GV.h
#ifdef GLOBAL_INSTANCE
#define GLOBAL
#else
#define GLOBAL extern
#endif
#include "Dxlib.h"
#include "function.h"
#include<iostream>
#include<fstream>
#include <math.h>
using namespace std;
#define PI 3.141592654f
//BMSカウント
GLOBAL LONGLONG starttime;
//Graoh
GLOBAL int bg;
GLOBAL int mero;
GLOBAL int notes;
GLOBAL int Graphcount;
GLOBAL int notesTest;
//Music
GLOBAL int BGM;
GLOBAL int SE;
//load.cpp
GLOBAL void load();
//music.cpp
GLOBAL void SERP();
GLOBAL void musicRP();
//Graph.cpp
GLOBAL void BgGraph();
GLOBAL void TestNotesGraph(int x, int y);
//BMScount.cpp
GLOBAL float Bmscount();
GLOBAL void BMSdraw(float a);
//KEY.cpp
GLOBAL int CheckKEY();
GLOBAL int CheckStateKey(unsigned char Handle);
#include "Dxlib.h"
#include"GV.h"
void load() {
//音ロード関係
BGM = LoadSoundMem("bg02.mp3");
SE = LoadSoundMem("SE01.wav");
//画像ロード関係
bg = LoadGraph("bg001.png");
mero = LoadGraph("bg004.png");
notes = LoadGraph("note.png");
notesTest = LoadGraph("notesTest.png");
}
#include "Dxlib.h"
#include"GV.h"
void BgGraph(){
DrawGraph(0, 0, bg, TRUE);
DrawRotaGraph(400, 140, 1.0 + sin(PI * 2 / 60 * Graphcount)*0.15, 0.0, mero, TRUE);
Graphcount++;
}
void TestNotesGraph(int x,int y) {
DrawGraph(0, 0, notesTest, TRUE);
}