SFML community forums

Help => General => Topic started by: botics on June 24, 2015, 03:35:08 pm

Title: SFML-2.3 error
Post by: botics on June 24, 2015, 03:35:08 pm
Hi!
Recently I downloaded SFML-2.3 and I can't get to work.
With SFML-2.1 everything works fine but with the 2.3 libs and include files it doesn't work.
I use Visual Studio 2013 on a x64 machine.

Anybody has any idea what's the problem?

This is the code and the errors.
#include <SFML/Graphics.hpp>

int main()
{

        sf::RenderWindow window(sf::VideoMode(400, 400), "saf");

        while (window.isOpen())
        {
                window.clear();
                window.display();
        }

}

1>------ Build started: Project: SFML-2.3-test, Configuration: Debug Win32 ------
1>  main.cpp
1>main.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 _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::~String(void)" (__imp_??1String@sf@@QAE@XZ) 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>main.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 _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::display(void)" (__imp_?display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (__imp_??0Color@sf@@QAE@EEEE@Z) referenced in function _main
1>main.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 _main
1>main.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 _main
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>C:\Users\Boti\Desktop\Projektek\C++\SFML\SFML-2.3-test\Debug\SFML-2.3-test.exe : fatal error LNK1120: 9 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

And here are my settings.
(http://s2.postimg.org/d47zirgih/Untitled1.png)
(http://s24.postimg.org/4z61w19n9/Untitled.png)
(http://s13.postimg.org/72b5fierb/Untitled3.png)
Title: Re: SFML-2.3 error
Post by: eXpl0it3r on June 24, 2015, 05:03:36 pm
Can you provide the verbose build command (http://www.sfml-dev.org/faq.php#tr-grl-verbose-ide)?
Title: Re: SFML-2.3 error
Post by: botics on June 24, 2015, 05:25:08 pm
This?
cl /c /I"E:\Programok\SFML-2.3\include" /ZI /W3 /WX- /sdl /Od /Oy- /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
Title: AW: SFML-2.3 error
Post by: eXpl0it3r on June 24, 2015, 05:43:45 pm
Well this is missing the wohle linking bit.
Title: Re: SFML-2.3 error
Post by: botics on June 24, 2015, 05:47:02 pm
I downloaded the 32-bit version of SFML and now it works fine.
Title: Re: SFML-2.3 error
Post by: Hapax on June 24, 2015, 09:43:48 pm
From your screenshots, it looks like you were trying to compile in 32-bit mode so that'll be why your 32-bit download works.
If you want to use the 64-bit SFML, you'll need to use it in a 64-bit "platform".