Jump to content

  • Log In with Google      Sign In   
  • Create Account

SFML 2.1 Setup Problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 foxcode   Members   -  Reputation: 251

Like
0Likes
Like

Posted 09 February 2014 - 12:28 PM

Hi everyone, I am having an annoying time setting up SFML 2.1, and think I need some extra pairs of eyes.

 

I have used the library before on visual studio 2008 without incident, but I have been unable to make it work on 2010 or 2012 express editions.

 

At first I thought SFML was compiled for the wrong IDE, so I downloaded the source and made them using CMake. Once the libraries were compiled, I tried again, but got exactly the same errors.

 

Currently I am focused on getting it to run in debug mode and am linking statically. I have included the SFML_STATIC deceleration and in linker input have made sure to link the -s-d libraries for static debug.

 

Here is the error list, there are 43

 

Error 43 error LNK1120: 37 unresolved externals E:\Programming\VisualStudioExpress2012\Asteroids\Debug\Asteroids.exe Asteroids
Error 3 error LNK2001: unresolved external symbol __imp__CreateWindowExA@48 E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 5 error LNK2001: unresolved external symbol __imp__DestroyWindow@4 E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 9 error LNK2001: unresolved external symbol __imp__GetDC@4 E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 11 error LNK2001: unresolved external symbol __imp__ReleaseDC@8 E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 7 error LNK2001: unresolved external symbol __imp__ShowWindow@8 E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 34 error LNK2019: unresolved external symbol __imp__AdjustWindowRect@12 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QAE@VVideoMode@2@ABVString@2@IABUContextSettings@2@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 18 error LNK2019: unresolved external symbol __imp__CallWindowProcA@20 referenced in function "private: static long __stdcall sf::priv::WindowImplWin32::globalOnEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?globalOnEvent@WindowImplWin32@priv@sf@@CGJPAUHWND__@@IIJ@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 42 error LNK2019: unresolved external symbol __imp__ChangeDisplaySettingsA@8 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::switchToFullscreen(class sf::VideoMode const &)" (?switchToFullscreen@WindowImplWin32@priv@sf@@AAEXABVVideoMode@3@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 40 error LNK2019: unresolved external symbol __imp__CreateIcon@28 referenced in function "public: virtual void __thiscall sf::priv::WindowImplWin32::setIcon(unsigned int,unsigned int,unsigned char const *)" (?setIcon@WindowImplWin32@priv@sf@@UAEXIIPBE@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 2 error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function "public: __thiscall sf::priv::WglContext::WglContext(class sf::priv::WglContext *)" (??0WglContext@priv@sf@@QAE@PAV012@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WglContext.obj) Asteroids
Error 23 error LNK2019: unresolved external symbol __imp__CreateWindowExW@48 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QAE@VVideoMode@2@ABVString@2@IABUContextSettings@2@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 16 error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function "private: static long __stdcall sf::priv::WindowImplWin32::globalOnEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?globalOnEvent@WindowImplWin32@priv@sf@@CGJPAUHWND__@@IIJ@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 17 error LNK2019: unresolved external symbol __imp__DefWindowProcW@16 referenced in function "private: static long __stdcall sf::priv::WindowImplWin32::globalOnEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?globalOnEvent@WindowImplWin32@priv@sf@@CGJPAUHWND__@@IIJ@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 41 error LNK2019: unresolved external symbol __imp__DestroyIcon@4 referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 4 error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WglContext.obj) Asteroids
Error 13 error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function "protected: virtual void __thiscall sf::priv::WindowImplWin32::processEvents(void)" (?processEvents@WindowImplWin32@priv@sf@@MAEXXZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 1 error LNK2019: unresolved external symbol __imp__EnumDisplaySettingsA@12 referenced in function "public: static class std::vector<class sf::VideoMode,class std::allocator<class sf::VideoMode> > __cdecl sf::priv::VideoModeImpl::getFullscreenModes(void)" (?getFullscreenModes@VideoModeImpl@priv@sf@@SA?AV?$vector@VVideoMode@sf@@V?$allocator@VVideoMode@sf@@@std@@@std@@XZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(VideoModeImpl.obj) Asteroids
Error 25 error LNK2019: unresolved external symbol __imp__GetAsyncKeyState@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned int,long)" (?processEvent@WindowImplWin32@priv@sf@@AAEXIIJ@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 27 error LNK2019: unresolved external symbol __imp__GetCapture@0 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned int,long)" (?processEvent@WindowImplWin32@priv@sf@@AAEXIIJ@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 32 error LNK2019: unresolved external symbol __imp__GetClientRect@8 referenced in function "public: virtual class sf::Vector2<unsigned int> __thiscall sf::priv::WindowImplWin32::getSize(void)const " (?getSize@WindowImplWin32@priv@sf@@UBE?AV?$Vector2@I@3@XZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 8 error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "public: __thiscall sf::priv::WglContext::WglContext(class sf::priv::WglContext *)" (??0WglContext@priv@sf@@QAE@PAV012@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WglContext.obj) Asteroids
Error 37 error LNK2019: unresolved external symbol __imp__GetWindowLongA@8 referenced in function "public: virtual void __thiscall sf::priv::WindowImplWin32::setSize(class sf::Vector2<unsigned int> const &)" (?setSize@WindowImplWin32@priv@sf@@UAEXABV?$Vector2@I@3@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 33 error LNK2019: unresolved external symbol __imp__GetWindowRect@8 referenced in function "public: virtual class sf::Vector2<int> __thiscall sf::priv::WindowImplWin32::getPosition(void)const " (?getPosition@WindowImplWin32@priv@sf@@UBE?AV?$Vector2@H@3@XZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 39 error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "public: virtual void __thiscall sf::priv::WindowImplWin32::setMouseCursorVisible(bool)" (?setMouseCursorVisible@WindowImplWin32@priv@sf@@UAEX_N@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 26 error LNK2019: unresolved external symbol __imp__MapVirtualKeyA@8 referenced in function "private: static enum sf::Keyboard::Key __cdecl sf::priv::WindowImplWin32::virtualKeyCodeToSF(unsigned int,long)" (?virtualKeyCodeToSF@WindowImplWin32@priv@sf@@CA?AW4Key@Keyboard@3@IJ@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 14 error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function "protected: virtual void __thiscall sf::priv::WindowImplWin32::processEvents(void)" (?processEvents@WindowImplWin32@priv@sf@@MAEXXZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 19 error LNK2019: unresolved external symbol __imp__RegisterClassA@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::registerWindowClass(void)" (?registerWindowClass@WindowImplWin32@priv@sf@@AAEXXZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 20 error LNK2019: unresolved external symbol __imp__RegisterClassW@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::registerWindowClass(void)" (?registerWindowClass@WindowImplWin32@priv@sf@@AAEXXZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 29 error LNK2019: unresolved external symbol __imp__ReleaseCapture@0 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned int,long)" (?processEvent@WindowImplWin32@priv@sf@@AAEXIIJ@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 10 error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WglContext.obj) Asteroids
Error 36 error LNK2019: unresolved external symbol __imp__ScreenToClient@8 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned int,long)" (?processEvent@WindowImplWin32@priv@sf@@AAEXIIJ@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 15 error LNK2019: unresolved external symbol __imp__SendMessageA@16 referenced in function "public: virtual void __thiscall sf::priv::WindowImplWin32::setIcon(unsigned int,unsigned int,unsigned char const *)" (?setIcon@WindowImplWin32@priv@sf@@UAEXIIPBE@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 28 error LNK2019: unresolved external symbol __imp__SetCapture@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned int,long)" (?processEvent@WindowImplWin32@priv@sf@@AAEXIIJ@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 35 error LNK2019: unresolved external symbol __imp__SetCursor@4 referenced in function "public: virtual void __thiscall sf::priv::WindowImplWin32::setMouseCursorVisible(bool)" (?setMouseCursorVisible@WindowImplWin32@priv@sf@@UAEX_N@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 38 error LNK2019: unresolved external symbol __imp__SetWindowLongA@12 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(struct HWND__ *)" (??0WindowImplWin32@priv@sf@@QAE@PAUHWND__@@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 24 error LNK2019: unresolved external symbol __imp__SetWindowPos@28 referenced in function "public: virtual void __thiscall sf::priv::WindowImplWin32::setPosition(class sf::Vector2<int> const &)" (?setPosition@WindowImplWin32@priv@sf@@UAEXABV?$Vector2@H@3@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 30 error LNK2019: unresolved external symbol __imp__SetWindowTextA@8 referenced in function "public: virtual void __thiscall sf::priv::WindowImplWin32::setTitle(class sf::String const &)" (?setTitle@WindowImplWin32@priv@sf@@UAEXABVString@3@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 31 error LNK2019: unresolved external symbol __imp__SetWindowTextW@8 referenced in function "public: virtual void __thiscall sf::priv::WindowImplWin32::setTitle(class sf::String const &)" (?setTitle@WindowImplWin32@priv@sf@@UAEXABVString@3@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 6 error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "public: __thiscall sf::priv::WglContext::WglContext(class sf::priv::WglContext *)" (??0WglContext@priv@sf@@QAE@PAV012@@Z) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WglContext.obj) Asteroids
Error 12 error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function "protected: virtual void __thiscall sf::priv::WindowImplWin32::processEvents(void)" (?processEvents@WindowImplWin32@priv@sf@@MAEXXZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 21 error LNK2019: unresolved external symbol __imp__UnregisterClassA@8 referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
Error 22 error LNK2019: unresolved external symbol __imp__UnregisterClassW@8 referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ) E:\Programming\VisualStudioExpress2012\Asteroids\Asteroids\sfml-window-s-d.lib(WindowImplWin32.obj) Asteroids
 
I would be grateful of any suggestions you may have, I have spent 3 hours trying to make this work but seem to be getting no where, thanks.
 


Sponsor:

#2 Dragonsoulj   Crossbones+   -  Reputation: 2126

Like
0Likes
Like

Posted 09 February 2014 - 01:58 PM

What does your source look like? Are you linking to -lsfml-main-s-d as well? This is a Windows OS linker to handle the lack of WinMain.



#3 Dragonsoulj   Crossbones+   -  Reputation: 2126

Like
0Likes
Like

Posted 09 February 2014 - 02:04 PM

Although it looks like it can't find the .lib files.



#4 foxcode   Members   -  Reputation: 251

Like
0Likes
Like

Posted 09 February 2014 - 02:18 PM

Hi Dragonsoulj, thanks for taking an interest.

 

My source code is the demo code as given by the SFML tutorial, here it is.
 

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}

With regards to the exact libraries I am including, here they are.

sfml-graphics-s-d.lib; sfml-system-s-d.lib; sfml-window-s-d.lib;  sfml-main-d.lib;

 

I am also providing the directories to include and lib, in the Project properties window, see below

E:\Programming\SFML_For2012Express\SFML-2.1\include

E:\Programming\SFML_For2012Express\SFML-2.1\lib

 

Having checked a million times, all needed files are in these 2 locations, and the directories themselves are correct.

 

To my knowledge there is no static version of the main-d.lib, in the past this version has always worked fine on VS2008 Pro edition, using the version of SFML compiled for that IDE of course.

 

I have used SFML many times before on the other IDE, for which it still works, I just cannot fathom why it wont work.


Edited by foxcode, 09 February 2014 - 02:20 PM.


#5 BitMaster   Crossbones+   -  Reputation: 4431

Like
2Likes
Like

Posted 10 February 2014 - 06:53 AM

That does not appear to be a problem directly related to SFML. All of the random samples I checked were Windows API functions. You don't seem to be linking to User32.lib. More platform libraries might be the culprit, but linking to that one will probably reduce the number of errors a lot.

#6 foxcode   Members   -  Reputation: 251

Like
0Likes
Like

Posted 10 February 2014 - 11:22 AM

Thank you so much BitMaster, included that and all the errors vanish. I don't understand why I didn't have to include that in the other IDE's I have used SFML with but thank you so much.



#7 Dragonsoulj   Crossbones+   -  Reputation: 2126

Like
0Likes
Like

Posted 10 February 2014 - 02:43 PM

Could be the linker order. Should be Graphics, Window, Main, System. Audio and Network can go before Graphics.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS