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

Author Topic: Errors when initializing a sf::RenderWindow variable  (Read 4006 times)

0 Members and 1 Guest are viewing this topic.

winsett

  • Newbie
  • *
  • Posts: 6
    • View Profile
Errors when initializing a sf::RenderWindow variable
« on: December 12, 2016, 02:46:41 pm »
Hi there, new to this forum and with a little experience with SFML programming.

I get these 3 errors when I try to compile a VS2015 c++ project.

Quote
Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::String(char const *,class std::locale const &)" (__imp_??0String@sf@@QAE@PBDABVlocale@std@@@Z) referenced in function "protected: virtual int __thiscall CBatteryAlarmDlg::OnInitDialog(void)" (?OnInitDialog@CBatteryAlarmDlg@@MAEHXZ)   BatteryAlarm   E:\docs\programirane\BatteryAlarm\BatteryAlarm\BatteryAlarmDlg.obj   1   

Error   LNK2019   unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::~String(void)" (__imp_??1String@sf@@QAE@XZ) referenced in function "protected: virtual int __thiscall CBatteryAlarmDlg::OnInitDialog(void)" (?OnInitDialog@CBatteryAlarmDlg@@MAEHXZ)   BatteryAlarm   E:\docs\programirane\BatteryAlarm\BatteryAlarm\BatteryAlarmDlg.obj   1   

Error   LNK1120   2 unresolved externals   BatteryAlarm   E:\docs\programirane\BatteryAlarm\BatteryAlarm\Debug\BatteryAlarm.exe   1   

These errors appear only when I add this peace of code:
Quote
sf::RenderWindow testWindow(sf::VideoMode(800, 600), "test window");

Could you help me resolve what I've done wrong? Thanks! :)

sjaustirni

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Errors when initializing a sf::RenderWindow variable
« Reply #1 on: December 12, 2016, 05:38:09 pm »
Please, always use Google before posting on any kind of forum. You'll avoid asking about one of the most asked question ever. :)
http://stackoverflow.com/questions/7004031/c-unresolved-externals

Unresolved externals error usually means that you have linked something incorrectly.  Please go through the tutorial and only when you get stuck come back with the question and a note where exactly you got stuck.

winsett

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Errors when initializing a sf::RenderWindow variable
« Reply #2 on: December 15, 2016, 07:43:27 pm »
Please, always use Google before posting on any kind of forum. You'll avoid asking about one of the most asked question ever. :)
http://stackoverflow.com/questions/7004031/c-unresolved-externals

Unresolved externals error usually means that you have linked something incorrectly.  Please go through the tutorial and only when you get stuck come back with the question and a note where exactly you got stuck.
Thank you for your reply, sjaustirni and for your directions!
I usually google before ask questions - this saves me lots of time but this time I couldn't find anything about this kind of error - it appears I didn't make good enough search. Now while I know its in the linker I fixed the problem.

sjaustirni

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Errors when initializing a sf::RenderWindow variable
« Reply #3 on: December 15, 2016, 08:41:20 pm »
No problem, glad I helped! :)

Good luck with your SFML projects! And make sure you let us know about them :)