Sign in to follow this  

FMOD compiling under mingw

This topic is 2352 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

[code]#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();
}
[/code]

I'm compiling through command line by doing [quote]g++ -o fmod.exe fmod.cpp[/quote]

which ultimately gives me all this


[code]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)[/code]



How do I go about compiling and linking?

Share this post


Link to post
Share on other sites

This topic is 2352 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this