FMOD compiling under mingw

Started by
-1 comments, last by rev2 12 years, 9 months ago
Hi there, I need some help in compiling the following FMOD example that I got from gamedev. I've downloaded and installed FMOD and have copied the libs and header files into mingw's inc and lib folders. Also the directory in which the source file is at has the two dll's fmodex.dll and fmodexL.dll.

#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?

This topic is closed to new replies.

Advertisement