While trying to compile the following:
#include <SFML/Audio.h>
#define EXIT_FAILURE 1;
#define EXIT_SUCCESS 0;
int main()
{
sfMusic* music;
/* Load a music to play */
music = sfMusic_createFromFile("nice_music.ogg");
if (!music)
return EXIT_FAILURE;
/* Play the music */
sfMusic_setPlayingOffset(music, 5000);
sfMusic_play(music);
sleep(20);
/* Cleanup resources */
sfMusic_destroy(music);
return EXIT_SUCCESS;
}
I get the error:
/tmp/cc6c8K17.o: In function `main':
demo.c:(.text+0x37): undefined reference to `sfMusic_setPlayingOffset'
collect2: ld returned 1 exit status
I'm using the command:
gcc -o demo demo.c -lcsfml-audio
If I remove or comment out the sfMusic_setPlayingOffset line everything works fine. I also tried every other function in Music.h and they all compile correctly.
One thing I noticed, in Music.cpp, is that the function is
sfMusic_setPlayingOffset(sfMusic* music, sfTime timeOffset) while in Music.h it's
sfMusic_setPlayingOffset(sfMusic* music, sfUint32 timeOffset)I tried making changes to Music.h and recompiling but it doesn't seem to solve the issue.