I´ve just started with CSFML and i am getting linking errors everytime i try to compile my app (i am using Visual Sudio 2005, as i´ve said in title).
I´ve included all needed libraries for app (csfml-audio.lib, csfml-graphics.lib, csfml-network.lib, csfml-system.lib, csfml-window.lib). Here is the code:
SoundSystem.h
#include <SFML/Audio.h>
#include "DataTypes.h"
// sound
extern void PlayMusic(C8 *FileName);
SoundSystem.cpp
#include "DataTypes.h"
#include "SoundSystem.h"
sfMusic *Music;
void PlayMusic(C8 *FileName)
{
sfMusic_CreateFromFile(FileName);
sfMusic_Play(Music);
// Loop while the music is playing
while(sfMusic_GetStatus(Music) == sfPlaying)
{
sfSleep(0.1f);
}
}
main.cpp
#include "SoundSystem.h"
int main()
{
PlayMusic("data/sound.ogg");
return EXIT_SUCCESS;
}
...and here are the linking errors.
1>Compiling...
1>main.cpp
1>SoundSystem.cpp
1>Linking...
1>SoundSystem.obj : error LNK2001: unresolved external symbol "void __cdecl sfMusic_Play(struct sfMusic *)" (?sfMusic_Play@@YAXPAUsfMusic@@@Z)
1>SoundSystem.obj : error LNK2001: unresolved external symbol "void __cdecl sfSleep(float)" (?sfSleep@@YAXM@Z)
1>SoundSystem.obj : error LNK2001: unresolved external symbol "struct sfMusic * __cdecl sfMusic_CreateFromFile(char const *)" (?sfMusic_CreateFromFile@@YAPAUsfMusic@@PBD@Z)
1>SoundSystem.obj : error LNK2001: unresolved external symbol "enum sfSoundStatus __cdecl sfMusic_GetStatus(struct sfMusic *)" (?sfMusic_GetStatus@@YA?AW4sfSoundStatus@@PAUsfMusic@@@Z)
1>..\bin32\game_c.exe : fatal error LNK1120: 4 unresolved externals
I don´t know if i´ve forgot to set some options to compiler or forgot to include some file... so i´m looking for a help.