• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
foxcode

SFML 2.1 Setup Problem

6 posts in this topic

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.
 
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites
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.
2

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0