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

Author Topic: Unresolved Externals just with Graphics  (Read 1885 times)

0 Members and 1 Guest are viewing this topic.

mctuble

  • Newbie
  • *
  • Posts: 2
    • View Profile
Unresolved Externals just with Graphics
« on: June 22, 2009, 02:45:53 pm »
So I'm using Visual C++ 2008 Express and I don't have any problems with say the thread sample. I just add sfml-system-d.lib to the linker and then the thread example works great. For some reason when I try graphics I get some pesky unresolved externals. The following is what my program outputs.

Code: [Select]
------ Build started: Project: SFMLtest, Configuration: Debug Win32 ------
Linking...
Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@QAEXXZ) referenced in function _main
Main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main
Main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
Main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main
C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\SFMLtest\Debug\SFMLtest.exe : fatal error LNK1120: 5 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\SFMLtest\SFMLtest\Debug\BuildLog.htm"
SFMLtest - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


So I've added sfml-graphics-d.lib to the linker along with sfml-system-d.lib just in case and also because I don't know if it's necessary I added sfml-main-d.lib. Though the linker errors I get are the same with or without system and main. I seem to think this might be an easily fixed error. Any idea guys?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Unresolved Externals just with Graphics
« Reply #1 on: June 22, 2009, 03:01:20 pm »
You also have to link to sfml-window.lib.
Laurent Gomila - SFML developer

mctuble

  • Newbie
  • *
  • Posts: 2
    • View Profile
Unresolved Externals just with Graphics
« Reply #2 on: June 22, 2009, 03:03:46 pm »
Ha, it's as easy as that. Thank you for the quick and simple response and thank you for the great library.

 

anything