Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - colin

Pages: [1]
1
C / Re: undefined reference to sfMusic_setPlayingOffset
« on: April 30, 2012, 05:36:05 pm »
Never mind, changing sfUint32 to sfTime in Music.h did fix the problem. I guess gcc just had the library cached or something because, after restarting my session, it compiled fine.

I'll fix it on git and submit a pull request.

2
C / undefined reference to sfMusic_setPlayingOffset
« on: April 30, 2012, 05:02:26 pm »
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:

Code: [Select]
/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:

Code: [Select]
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.

Pages: [1]
anything