I saw a code in the net yesterday about playing sounds, and I managed to play it too, using a dev-c++ project file. What I'm now trying to do is put it in my game, though I get compiler errors when I compile it because we have a custom header file named mp.h that contains most of the functions that we need in our game. Here's the code I tried.
Code:#include <windows.h> #include <stdlib.h> using namespace std; int main() { int x = 1; while (x == 1) PlaySound("gameover.wav", NULL, SND_FILENAME); system("PAUSE"); return 0; }
I saw another code in the internet about mmstream.h and I managed to get pass the mp.h compiler error, but it gets a linker error saying "Undefined reference to PlaySoundA@12". Here is the revised code.
Any information helpful would be much appreciated. Thanks!Code:#include <windows.h> #include <stdlib.h> #include <mp.h> #include <mmsystem.h> #pragma comment(lib, "winmm.lib") int main() { int x = 1; while (x == 1) PlaySound("gameover.wav", NULL, SND_FILENAME); system("PAUSE"); return 0; }



LinkBack URL
About LinkBacks



