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

Author Topic: [Help] Errors when Compiling  (Read 8067 times)

0 Members and 1 Guest are viewing this topic.

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
[Help] Errors when Compiling
« 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

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

Gobbles

  • Full Member
  • ***
  • Posts: 132
    • View Profile
    • Email
Re: [Help] Errors when Compiling
« Reply #1 on: September 09, 2013, 06:49:00 am »
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,

Lambert

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: [Help] Errors when Compiling
« Reply #2 on: September 09, 2013, 06:52:37 am »
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.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: [Help] Errors when Compiling
« Reply #3 on: September 09, 2013, 06:57:27 am »
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.

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Help] Errors when Compiling
« Reply #4 on: September 09, 2013, 05:31:28 pm »
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!

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Back to C++ gamedev with SFML in May 2023

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Help] Errors when Compiling
« Reply #6 on: September 09, 2013, 06:00:25 pm »
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!

paulmc2021

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: [Help] Errors when Compiling
« Reply #7 on: February 23, 2021, 02:34:38 am »
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!