SFML community forums
Help => General => Topic started by: Guzfraba 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 (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 (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 ?
-
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.
-
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 ==========
-
...any idea ?
-
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)
-
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 ?
-
You also need to place .dlls in your working folder.. usually where .vcproj file is by default.
-
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 ?
-
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.
-
Static libraries are directly integrated to your executable when you compile it, there's no DLL file to distribute with your application.