Hello all. I have a simple source file (see below) to play an ogg file. Compiling with MinGW/MSYS on Windows XP using
gcc filename.c -o filename.exe -lcsfml-audio
or
gcc filename.c -o filename.exe -lcsfml-audio-d
appears to create the executable, however, when the executable is activated, a (command-prompt) window appears for an instant and then quickly disappears, with no sound being played and no error messages being displayed. The ogg file is located in the same location as the executable. When the ogg file referred to in the script is absent, I receive a "Failed to open 'absentfile.ogg' for reading" error message before the program shuts down. The SFML code i'm using is:
#include <SFML/Audio.h>
main()
{
sfMusic* Music;
/* Load a music to play */
Music = sfMusic_CreateFromFile("soundfile.ogg");
/* Play the music */
sfMusic_Play(Music);
/* Cleanup resources */
sfMusic_Destroy(Music);
}
Any suggestions would be appreciated. Thanks.