#include
#include "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'm compiling through command line by doing
g++ -o fmod.exe fmod.cpp[/quote]
which ultimately gives me all this
C:\Documents and Settings\rs\Desktop\sample>g++ -o fmod.exe fmod.cpp
fmod.cpp:1:10: #include expects "FILENAME" or <FILENAME>
fmod.cpp:5: error: expected constructor, destructor, or type conversion before '*' token
fmod.cpp:5: error: expected `,' or `;' before '*' token
fmod.cpp: In function `int main()':
fmod.cpp:10: error: `FSOUND_Init' undeclared (first use this function)
fmod.cpp:10: error: (Each undeclared identifier is reported only once for each function it appears in.)
fmod.cpp:13: error: `handle' undeclared (first use this function)
fmod.cpp:13: error: `FSOUND_Sample_Load' undeclared (first use this function)
fmod.cpp:14: error: `FSOUND_PlaySound' undeclared (first use this function)
fmod.cpp:17: error: `_kbhit' undeclared (first use this function)
fmod.cpp:22: error: `FSOUND_Sample_Free' undeclared (first use this function)
fmod.cpp:23: error: `FSOUND_Close' undeclared (first use this function)
How do I go about compiling and linking?