SFML community forums
Help => General => Topic started by: TCVM on September 09, 2013, 06:25:19 am
-
Hello all, today I present a error. I do not know what it is, it is gibberish for me
Error 5 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Sound::setBuffer(class sf::SoundBuffer const &) (__imp_setBuffer@Sound@sf@@QAEXABVSoundBuffer@2@@Z) referenced in function _main C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLAudio\SFMLAudio\SFMLAudio.obj
SFMLAudiov Error 4 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Sound::play(void)" (__imp_?play@Sound@sf@@QAEXXZ) referenced in function _main C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLAudio\SFMLAudio\SFMLAudio.obj SFMLAudio
Error 3 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Sound::~Sound(void)" (__imp_??1Sound@sf@@UAE@XZ) referenced in function _main C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLAudio\SFMLAudio\SFMLAudio.obj SFMLAudio
Error 8 error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::SoundBuffer::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?loadFromFile@SoundBuffer@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLAudio\SFMLAudio\SFMLAudio.obj SFMLAudio
Error 6 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::SoundBuffer::SoundBuffer(void)" (__imp_??0SoundBuffer@sf@@QAE@XZ) referenced in function _main C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLAudio\SFMLAudio\SFMLAudio.obj SFMLAudio
Error 7error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::SoundBuffer::~SoundBuffer(void)" (__imp_??1SoundBuffer@sf@@QAE@XZ) referenced in function _main C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLAudio\SFMLAudio\SFMLAudio.obj SFMLAudio
Error 2error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Sound::Sound(void)" (__imp_??0Sound@sf@@QAE@XZ) referenced in function _main C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLAudio\SFMLAudio\SFMLAudio.obj SFMLAudio
Error 9 error LNK1120: 7 unresolved externals C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLAudio\Debug\SFMLAudio.exe SFMLAudio
and a bit more. Please do help. Also, I did search google but what came up didn't seem to help. Thanks!
-
Well your certainly not giving us much more to work on.
Compiler? Version? Library version?
how are you linking(Dynamic vs Static)? Did you follow the tutorial exactly as it's written including the red blocks?
What are you trying to build? etc etc.
Also you might want to learn to read this 'gibberish', there's going to be lots more in your future,
-
Well, you provided very small amount of informations, but I will guess that something is wrong with your SFML Audio package. Check your installation of SFML (especially if you linked audio libraries) and if that doesn't help - reinstall SFML.
-
Some hints to help you learn how to read the gibberish.
1) Those are linker errors, as opposed to compiler errors. You should read up on exactly what the compiler, linker, loader, etc. all do, because they are very different programs.
2) Once you understand what linking is, it should be fairly obvious that these particular link errors mean "the linker expected to find something called X because you used it in one part of your program, but it couldn't find X anywhere in your program or the stuff you linked it to." Usually that means you aren't linking to all of the right libraries. But sometimes these can be caused by errors in your code, such as declaring a function and never defining it, not putting the right things in cpp versus hpp files, or forgetting/misusing keywords like extern. In my experience googling the specific linker error number and message (in this case, "LNK2019: unresolved external symbol") usually helps pin down those issues.
-
I am sorry, I was very tired when I typed that originally. I am using VC++ 2012. And with the linking errors, what libraries exactly do I have to link? I have yet to find a proper VC++ 2012 SFML Install guide. Then again, I am probablly looking in the wrong places
Cheers!
-
http://www.sfml-dev.org/tutorials/2.1/start-vc.php
-
Thank you Frex, now, with the "Compiled Executible" where exactly is that located? Is that where I made the project? Or somewhere in the VS file?
Cheers!
-
Got the same error as this user over 120 days later. This highlights that the library is not up to much when the sample code doesn't even build. Time for me to look elsewhere!