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

Author Topic: Latest GitHub Snapshot - Graphics example doesn't work  (Read 2853 times)

0 Members and 1 Guest are viewing this topic.

RaptorIV

  • Newbie
  • *
  • Posts: 30
    • View Profile
Latest GitHub Snapshot - Graphics example doesn't work
« on: October 13, 2011, 09:55:47 pm »
Hello all,

I recently downloaded and successfully built the latest version of SFML from github but when I try to run the example graphics program (from the tutorials) it fails with the following errors.

Code: [Select]

1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (?Clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@QAEXXZ) referenced in function _main
1>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
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function _main
1>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
1>C:\Projects\SFML\sfml-test\Debug\sfml-test.exe : fatal error LNK1120: 9 unresolved externals


Can anyone help me?

(I'm using Visual Studio 10)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Latest GitHub Snapshot - Graphics example doesn't work
« Reply #1 on: October 13, 2011, 10:07:37 pm »
Have you linked SFML? If so, how?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Latest GitHub Snapshot - Graphics example doesn't work
« Reply #2 on: October 13, 2011, 10:09:51 pm »
Are you linking to static or dynamic libraries? And, sf::Window::GetEvent doesn't exist anymore. This must be an old version.
Laurent Gomila - SFML developer

RaptorIV

  • Newbie
  • *
  • Posts: 30
    • View Profile
Latest GitHub Snapshot - Graphics example doesn't work
« Reply #3 on: October 13, 2011, 10:55:02 pm »
static i beleive.

I changed the code:
Code: [Select]

1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (__imp_??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::ContextSettings const &)" (__imp_??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUContextSettings@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>C:\Projects\SFML\sfml-test\Debug\sfml-test.exe : fatal error LNK1120: 3 unresolved externals

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Latest GitHub Snapshot - Graphics example doesn't work
« Reply #4 on: October 13, 2011, 11:15:12 pm »
If you link statically, you must define SFML_STATIC.

Please tell us exactly what linker entries you have and which configuration (static or dynamic, release or debug). You have specified the configuration when creating the Visual Studio 2010 project with CMake.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

RaptorIV

  • Newbie
  • *
  • Posts: 30
    • View Profile
Latest GitHub Snapshot - Graphics example doesn't work
« Reply #5 on: October 14, 2011, 12:34:47 am »
Here are the libraries i link



Release type in cmake

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Latest GitHub Snapshot - Graphics example doesn't work
« Reply #6 on: October 14, 2011, 12:40:44 am »
You don't link a library at all. You just specify some directories, but the wrong ones -- there is the source code, not the binary .lib files.

After installing SFML (compiling the INSTALL project), choose the directory SFML/lib as library directory. Then link the libraries (i.e. enter them at Linker -> Input), where "xy" is a component like "graphics" or "system":
  • Dynamic Release: sfml-xy.lib
  • Dynamic Debug: sfml-xy-d.lib
  • Static Release: sfml-xy-s.lib
  • Static Debug: sfml-xy-s-d.lib
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: