I am trying to get started with FMOD, but I am having problems compiling the sample code in this tutorial:
http://www.gamedev.net/reference/articles/article2098.asp
I use MinGW, I put the file libfmodex.a in the MinGW include folder (I also tried to link directly to the file name), but this will not work. Here is the conclusion.
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 a specific example that I am using:
#include <conio.h>
#include "inc/fmod.h"
FSOUND_SAMPLE* handle;
int main ()
{
FSOUND_Init (44100, 32, 0);
handle=FSOUND_Sample_Load (0,"sample.mp3",0, 0, 0);
FSOUND_PlaySound (0,handle);
while (!_kbhit())
{
}
FSOUND_Sample_Free (handle);
FSOUND_Close();
}
I have header files in the "inc" path where my code is located. Any ideas on what I'm doing wrong?
Cptaj source
share