繁体   English   中英

FMOD编译麻烦

[英]FMOD Compiling trouble

我正在尝试开始使用FMOD,但我在编写本教程中的示例代码时遇到了一些问题:

http://www.gamedev.net/reference/articles/article2098.asp

我正在使用MinGW,我将libfmodex.a文件放在MinGW的include文件夹中(我也尝试直接链接到文件名),但它不起作用。 这是输出。

C:\>g++ -o test1.exe test1.cpp -lfmodex
test1.cpp:4:1: error: 'FSOUND_SAMPLE' does not name a type
test1.cpp: In function 'int main()':
test1.cpp:9:29: error: 'FSOUND_Init' was not declared in this scope
test1.cpp:12:4: error: 'handle' was not declared in this scope
test1.cpp:12:53: error: 'FSOUND_Sample_Load' was not declared in this scope
test1.cpp:13:30: error: 'FSOUND_PlaySound' was not declared in this scope
test1.cpp:21:30: error: 'FSOUND_Sample_Free' was not declared in this scope
test1.cpp:22:17: error: 'FSOUND_Close' was not declared in this scope

这是我正在使用的特定示例:

#include <conio.h>
#include "inc/fmod.h"

FSOUND_SAMPLE* handle;

int main ()
{
   // init FMOD sound system
   FSOUND_Init (44100, 32, 0);

   // load and play sample
   handle=FSOUND_Sample_Load (0,"sample.mp3",0, 0, 0);
   FSOUND_PlaySound (0,handle);

   // wait until the users hits a key to end the app
   while (!_kbhit())
   {
   }

   // clean up
   FSOUND_Sample_Free (handle);
   FSOUND_Close();
}

我在我的代码所在的“inc”路径中有头文件。 关于我做错了什么的任何想法?

这是一个旧教程,从那时起FMOD API发生了变化。

例如,它现在是FMOD::Sound (我认为),而不是FSOUND_SAMPLE

看看你的fmod.h ,你可以看到你应该使用哪些类和函数。

gamedev文章很老,并且使用了旧版本的库。 请参阅FMOD Programmers API的examples目录。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM