Jump to content
  • Advertisement
Sign in to follow this  
rev2

FMOD compiling under mingw

This topic is 2571 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.

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

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!