用mingw编译FMOD?
我有来自 gamedev 的以下示例,我想知道您将如何编译它。我已下载 FMOD 并将其安装在 C:\Program Files\FMOD SoundSystem\FMOD Programmers API Win32
中。我的工作目录中有 .dll 和 mp3 文件,但我不确定什么/如何通过命令行编译和链接它?
编辑:代码
#include
#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 following example from gamedev, and I was wondering how you would go about compiling this. I've downloaded FMOD and its installed in C:\Program Files\FMOD SoundSystem\FMOD Programmers API Win32
. And I have the .dll's and a mp3 file in my working directory but I'm not sure what/how to compile and link this through command line?
EDIT: code
#include
#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();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该代码适用于 FMOD3,我建议从 www.fmod.org 获取最新版本的 FMODEx 又名 FMOD4。
编译时实际上不必做任何特殊的事情,只需确保“-I”包含包含“inc/fmod.h”的目录和“-L”包含 fmod lib 的“lib”目录,最后是“-” l' 实际的 fmod 库。
That code is for FMOD3, I would recommend getting the latest release of FMODEx aka FMOD4 from www.fmod.org.
When compiling really don't have to do anything special, just ensure you '-I' include the directory that contains "inc/fmod.h" and '-L' the "lib" directory that contains the fmod lib and lastly '-l' the actual fmod lib.