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

Author Topic: Installing sfml2 on VC++ express  (Read 1571 times)

0 Members and 1 Guest are viewing this topic.

Guzfraba

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Installing sfml2 on VC++ express
« on: February 17, 2013, 10:31:44 am »
Hello :)
I'm trying to install sfml 2 on viusal c++ express 2010...
I followed this tutorial http://www.sfml-dev.org/tutorials/2.0/start-vc.php 3-4 times,and every time i got the same errors...and yes,I read it carefully...
Today i followed this tutorial(Raptor88's post) http://en.sfml-dev.org/forums/index.php?topic=8285.0 , but again errors...I'm disappointed....
Could anybody help me via teamviewer,or something ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Installing sfml2 on VC++ express
« Reply #1 on: February 17, 2013, 11:12:25 am »
Quote
every time i got the same errors
We won't be able to help you if you don't give more details about these errors.
Laurent Gomila - SFML developer

Guzfraba

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Installing sfml2 on VC++ express
« Reply #2 on: February 17, 2013, 11:34:35 am »
I used the example in the tutorial:

1>------ Build started: Project: sfml4, Configuration: Debug Win32 ------
1>  main.cpp
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::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 LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
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::pollEvent(class sf::Event &)" (?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) 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: void __thiscall sf::Shape::setFillColor(class sf::Color const &)" (?setFillColor@Shape@sf@@QAEXABVColor@2@@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 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 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 int,struct sf::ContextSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IABUContextSettings@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>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>c:\documents and settings\pa mama\my documents\visual studio 2010\Projects\sfml4\Debug\sfml4.exe : fatal error LNK1120: 15 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Guzfraba

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Installing sfml2 on VC++ express
« Reply #3 on: February 17, 2013, 12:32:15 pm »
...any idea ?

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Installing sfml2 on VC++ express
« Reply #4 on: February 17, 2013, 12:54:27 pm »
You are not linking to sfml properly.(project propeties/linker/input/additional dependancies, you should have sfml-system-d.lib sfml-window-d.lib sfml-graphics-d.lib or without (-d suffix is for debug, without it if it's compiling as release)also can have additional -s suffix if you use static libs but then you need to define SFML_STATIC in preprocessor)
« Last Edit: February 17, 2013, 12:56:50 pm by FRex »
Back to C++ gamedev with SFML in May 2023

Guzfraba

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Installing sfml2 on VC++ express
« Reply #5 on: February 17, 2013, 01:14:56 pm »
I've done this,but:

(error box)
sfml4.exe - Unable To Locate Component
This application has failed to start because sfml-graphics-d-2.dll was not found. Re-installing the application may fix the problem.


What should I do ?
« Last Edit: February 17, 2013, 01:17:26 pm by Guzfraba »

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Installing sfml2 on VC++ express
« Reply #6 on: February 17, 2013, 01:19:31 pm »
You also need to place .dlls in your working folder.. usually where .vcproj file is by default.
Back to C++ gamedev with SFML in May 2023

Guzfraba

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Installing sfml2 on VC++ express
« Reply #7 on: February 17, 2013, 01:31:49 pm »
I've done this....and Omg it's working !! Thank you :)

One more question,what is the difference between the static libraries and the normal ones ?
When should i use one, and when the other one ?

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Installing sfml2 on VC++ express
« Reply #8 on: February 17, 2013, 02:08:29 pm »
I don't know which is better, it's very complex issue. It doesn't matter that much and it takes few seconds to change so just use whichever you prefer I guess.
Back to C++ gamedev with SFML in May 2023

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Installing sfml2 on VC++ express
« Reply #9 on: February 17, 2013, 02:43:30 pm »
Static libraries are directly integrated to your executable when you compile it, there's no DLL file to distribute with your application.
Laurent Gomila - SFML developer