FMOD编译问题

发布于 2024-10-10 11:55:45 字数 1384 浏览 0 评论 0原文

我正在尝试开始使用 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”路径中有头文件。关于我做错了什么有什么想法吗?

I'm trying to get started with FMOD but I'm having some issues compiling the example code in this tutorial:

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

I'm using MinGW, I placed the libfmodex.a file in MinGW's include folder (I also tried linking directly to the filename) but it doesn't work. Here's the output.

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

This is the particular example I'm using:

#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();
}

I have the header files in the "inc" path where my code is. Any ideas as to what I'm doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寻找一个思念的角度 2024-10-17 11:55:45

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

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

查看 fmod.h 内部,您可以看到应该使用哪些类和函数。

That is an old tutorial, the FMOD API has changed since then.

For example, instead of FSOUND_SAMPLE, it is now FMOD::Sound (I think).

Have a look inside your fmod.h and you can see what classes and functions you should be using.

单挑你×的.吻 2024-10-17 11:55:45

gamedev 文章很旧,并且明显使用了旧版本的库。请参阅 FMOD 程序员 API 的示例目录。

The gamedev article is old and obsiously uses an old version of the library. See the examples directory of the FMOD Programmers API.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文