尝试从其他类调用函数
我正在尝试让 FMOD
工作,但我无法让 main()
调用它
int main()
{
cout << "Using FMOD \n";
cout << "Select a Track: 1-5 Horror \n";
cin >> HorrorTrack;
AudioProject *pAudioProject = new AudioProject;
pAudioProject->initAudio();
//AudioProject::initAudio();
MainPage(); // Main Page Function
if (pAudioProject)
{
delete pAudioProject;
pAudioProject=NULL;
}
char f;
cin>>f;
return 0;
}
我遇到的错误是:
函数 _main 中引用了未解析的外部符号“public: __thiscall AudioProject::AudioProject(void)”(??0AudioProject@@QAE@XZ)
1>C:\Users\CodeMonkey\Desktop\AudioProject\Debug\AudioProject.exe:致命错误 LNK1120:1 个无法解析的外部。
它来自声明为 public
的 .h
文件变量。但是,如果我将 initAudio
设置为 public
之外的任何内容,我将无法在 main()
函数中访问它。有什么想法吗?
I'm trying to get FMOD
working but I just can't get the main()
to call it
int main()
{
cout << "Using FMOD \n";
cout << "Select a Track: 1-5 Horror \n";
cin >> HorrorTrack;
AudioProject *pAudioProject = new AudioProject;
pAudioProject->initAudio();
//AudioProject::initAudio();
MainPage(); // Main Page Function
if (pAudioProject)
{
delete pAudioProject;
pAudioProject=NULL;
}
char f;
cin>>f;
return 0;
}
The errors I'm getting are:
unresolved external symbol "public: __thiscall AudioProject::AudioProject(void)" (??0AudioProject@@QAE@XZ) referenced in function _main
1>C:\Users\CodeMonkey\Desktop\AudioProject\Debug\AudioProject.exe : fatal error LNK1120: 1 unresolved externals.
Which is from the .h
file variables which are declared public
. However, if I make the initAudio
anything but public
I wont be able to access it in my main()
function. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尚未链接该库,因此无法找到它导出的符号的定义。
请阅读此“FMOD”的说明。
You haven't linked the library, so the definitions of symbols that it exports cannot be found.
Read this "FMOD"'s instructions.