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

Author Topic: SFML installation errors visual studio 2012  (Read 5101 times)

0 Members and 1 Guest are viewing this topic.

alext94

  • Newbie
  • *
  • Posts: 16
    • View Profile
SFML installation errors visual studio 2012
« on: August 06, 2013, 03:10:23 am »
I have done it step by step 3 times and done it right and I get this:
1>------ Build started: Project: game, Configuration: Debug Win32 ------
1>  Main.cpp
1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::String::String(char const *,class std::locale const &)" (??0String@sf@@QAE@PBDABVlocale@std@@@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>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::isOpen(void)const " (?isOpen@Window@sf@@QBE_NXZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) 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: __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::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: void __thiscall sf::RenderTarget::draw(class sf::Drawable const &,class sf::RenderStates const &)" (?draw@RenderTarget@sf@@QAEXABVDrawable@2@ABVRenderStates@2@@Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABVString@1@IABUContextSettings@1@@Z) referenced in function _main
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: virtual __thiscall sf::Shape::~Shape(void)" (??1Shape@sf@@UAE@XZ) referenced in function "public: virtual __thiscall sf::CircleShape::~CircleShape(void)" (??1CircleShape@sf@@UAE@XZ)
1>Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Shape::setFillColor(class sf::Color const &)" (?setFillColor@Shape@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::CircleShape::CircleShape(float,unsigned int)" (??0CircleShape@sf@@QAE@MI@Z) referenced in function _main
1>Main.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)
1>Main.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1>C:\Users\alex\Desktop\game\Debug\game.exe : fatal error LNK1120: 16 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
what do it do ??

Barlog

  • Guest
Re: SFML installation errors visual studio 2012
« Reply #1 on: August 06, 2013, 07:38:46 am »
Greetings.

If you did everything correctly, you would not see the linker errors. :)

Double check path to sfml lib folder in "Linker » General » Additional Library Directories".

Make sure you entered correct libraries in "Linker » Input » Additional Dependencies".
You should use "sfml-graphics.lib", "sfml-window.lib" and "sfml-system.lib" for release configuration.
And "sfml-graphics-d.lib", "sfml-window-d.lib" and "sfml-system-d.lib" for debug configuration.

edit. And I totally forgot about static and dynamic versions :) As Laurent pointed out.
« Last Edit: August 06, 2013, 07:53:03 am by Tirion Helkaraxe »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML installation errors visual studio 2012
« Reply #2 on: August 06, 2013, 07:47:35 am »
Don't mix dynamic and static settings.
Laurent Gomila - SFML developer

alext94

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: SFML installation errors visual studio 2012
« Reply #3 on: August 06, 2013, 07:15:24 pm »
I re-installed it all now i am getting missing "sfml-system-d-2.dll missing from your computer" when I try to run anything !Any help ??

Barlog

  • Guest
Re: SFML installation errors visual studio 2012
« Reply #4 on: August 06, 2013, 07:25:39 pm »
I re-installed it all now i am getting missing "sfml-system-d-2.dll missing from your computer" when I try to run anything !Any help ??

Manually copy sfml-xxx-d-2.dll from bin folder in sfml archive to directory where your executable is located. (usually Debug folder in project directory).
Copy sfml-xxx-2.dll to Release directory.

Or write post-build rules to copy there files in project options.

alext94

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: SFML installation errors visual studio 2012
« Reply #5 on: August 06, 2013, 07:29:14 pm »
I get
1>------ Build started: Project: Game, Configuration: Debug Win32 ------
1>  main.cpp
1>Game.obj : 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 "void __cdecl `dynamic initializer for 'Window''(void)" (??__EWindow@@YAXXZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::~String(void)" (__imp_??1String@sf@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'Window''(void)" (??__EWindow@@YAXXZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::close(void)" (__imp_?close@Window@sf@@QAEXXZ) referenced in function "private: void __thiscall game::Process_Events(void)" (?Process_Events@game@@AAEXXZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::isOpen(void)const " (__imp_?isOpen@Window@sf@@QBE_NXZ) referenced in function "public: void __thiscall game::Run(void)" (?Run@game@@QAEXXZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (__imp_?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function "private: void __thiscall game::Process_Events(void)" (?Process_Events@game@@AAEXXZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::display(void)" (__imp_?display@Window@sf@@QAEXXZ) referenced in function "private: void __thiscall game::Render(void)" (?Render@game@@AAEXXZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::RenderTarget::clear(class sf::Color const &)" (__imp_?clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function "private: void __thiscall game::Render(void)" (?Render@game@@AAEXXZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::RenderTarget::draw(class sf::Drawable const &,class sf::RenderStates const &)" (__imp_?draw@RenderTarget@sf@@QAEXABVDrawable@2@ABVRenderStates@2@@Z) referenced in function "private: void __thiscall game::Render(void)" (?Render@game@@AAEXXZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (__imp_??0RenderWindow@sf@@QAE@VVideoMode@1@ABVString@1@IABUContextSettings@1@@Z) referenced in function "void __cdecl `dynamic initializer for 'Window''(void)" (??__EWindow@@YAXXZ)
1>Game.obj : error LNK2019: unresolved external symbol "private: void __thiscall game::Update(void)" (?Update@game@@AAEXXZ) referenced in function "public: void __thiscall game::Run(void)" (?Run@game@@QAEXXZ)
1>Game.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class sf::RenderStates const sf::RenderStates::Default" (__imp_?Default@RenderStates@sf@@2V12@B)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::CircleShape::CircleShape(float,unsigned int)" (__imp_??0CircleShape@sf@@QAE@MI@Z) referenced in function "public: __thiscall game::game(void)" (??0game@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::CircleShape::~CircleShape(void)" (__imp_??1CircleShape@sf@@UAE@XZ) referenced in function "public: __thiscall game::~game(void)" (??1game@@QAE@XZ)
1>C:\Users\alex\Desktop\Sfml-Stuff\Game\Debug\Game.exe : fatal error LNK1120: 13 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

now! been trying for days to get this to work

alext94

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: SFML installation errors visual studio 2012
« Reply #6 on: August 06, 2013, 07:45:53 pm »
On linker input ,configuration release i have put : sfml-graphics.lib;sfml-window.lib;sfml-system.lib
and on the same page but configuration debug(not active(debug)) i put :
sfml-graphics-d.lib;sfml-window-d.lib;sfml-system-d.lib;

i haven't put SFML-STATIC in the c/c++ pre-processor , i tried it didnt fix the problem , i have out the dll's in the debug folders doesn't make any difference either

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFML installation errors visual studio 2012
« Reply #7 on: August 07, 2013, 08:32:39 am »
i haven't put SFML-STATIC in the c/c++ pre-processor , i tried it didnt fix the problem , i have out the dll's in the debug folders doesn't make any difference either
SFML_STATIC

Can you provide us with a log as described here: http://en.sfml-dev.org/forums/index.php?topic=12552.0

It would help us to track down the problem.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

 

anything