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

Author Topic: VC2010 & SFML 2.0  (Read 3927 times)

0 Members and 1 Guest are viewing this topic.

Elffus

  • Newbie
  • *
  • Posts: 13
    • View Profile
VC2010 & SFML 2.0
« on: August 17, 2010, 11:10:01 pm »
For some reason VC2010 outputs all of these errors when trying to build:

Code: [Select]
1>------ Build started: Project: Game, Configuration: Debug Win32 ------
1>Build started 17/08/2010 22:02:23.
1>InitializeBuildStatus:
1>  Touching "Debug\Game.unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>ManifestResourceCompile:
1>  All outputs are up-to-date.
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>sfml-window-s-d.lib(VideoModeImpl.obj) : 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)
1>sfml-window-s-d.lib(WglContext.obj) : 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)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__GetDC@4
1>sfml-window-s-d.lib(WglContext.obj) : 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)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__ShowWindow@8
1>sfml-window-s-d.lib(WglContext.obj) : 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)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__DestroyWindow@4
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__ReleaseDC@8
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__SwapBuffers@4 referenced in function "public: virtual void __thiscall sf::priv::WglContext::Display(void)" (?Display@WglContext@priv@sf@@UAEXXZ)
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__SetPixelFormat@12 referenced in function "private: void __thiscall sf::priv::WglContext::CreateContext(class sf::priv::WglContext *,unsigned int,struct sf::ContextSettings const &)" (?CreateContext@WglContext@priv@sf@@AAEXPAV123@IABUContextSettings@3@@Z)
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__ChoosePixelFormat@8 referenced in function "private: void __thiscall sf::priv::WglContext::CreateContext(class sf::priv::WglContext *,unsigned int,struct sf::ContextSettings const &)" (?CreateContext@WglContext@priv@sf@@AAEXPAV123@IABUContextSettings@3@@Z)
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__DescribePixelFormat@16 referenced in function "private: void __thiscall sf::priv::WglContext::CreateContext(class sf::priv::WglContext *,unsigned int,struct sf::ContextSettings const &)" (?CreateContext@WglContext@priv@sf@@AAEXPAV123@IABUContextSettings@3@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetWindowLongA@12 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(void *)" (??0WindowImplWin32@priv@sf@@QAE@PAX@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__GetClientRect@8 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(void *)" (??0WindowImplWin32@priv@sf@@QAE@PAX@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__CreateWindowExW@48 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long)" (??0WindowImplWin32@priv@sf@@QAE@VVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@K@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__AdjustWindowRect@12 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long)" (??0WindowImplWin32@priv@sf@@QAE@VVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@K@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__GetDeviceCaps@8 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long)" (??0WindowImplWin32@priv@sf@@QAE@VVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@K@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__UnregisterClassA@8 referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__UnregisterClassW@8 referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__DestroyIcon@4 referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ProcessEvents(bool)" (?ProcessEvents@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ProcessEvents(bool)" (?ProcessEvents@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ProcessEvents(bool)" (?ProcessEvents@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__WaitMessage@0 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ProcessEvents(bool)" (?ProcessEvents@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetCursor@4 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ShowMouseCursor(bool)" (?ShowMouseCursor@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ShowMouseCursor(bool)" (?ShowMouseCursor@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetCursorPos@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetCursorPosition(unsigned int,unsigned int)" (?SetCursorPosition@WindowImplWin32@priv@sf@@EAEXII@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__ClientToScreen@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetCursorPosition(unsigned int,unsigned int)" (?SetCursorPosition@WindowImplWin32@priv@sf@@EAEXII@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetWindowPos@28 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetPosition(int,int)" (?SetPosition@WindowImplWin32@priv@sf@@EAEXHH@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__GetWindowLongA@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetSize(unsigned int,unsigned int)" (?SetSize@WindowImplWin32@priv@sf@@EAEXII@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetWindowTextA@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetTitle(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?SetTitle@WindowImplWin32@priv@sf@@EAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SendMessageA@16 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetIcon(unsigned int,unsigned int,unsigned char const *)" (?SetIcon@WindowImplWin32@priv@sf@@EAEXIIPBE@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__CreateIcon@28 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetIcon(unsigned int,unsigned int,unsigned char const *)" (?SetIcon@WindowImplWin32@priv@sf@@EAEXIIPBE@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__RegisterClassA@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::RegisterWindowClass(void)" (?RegisterWindowClass@WindowImplWin32@priv@sf@@AAEXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__RegisterClassW@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::RegisterWindowClass(void)" (?RegisterWindowClass@WindowImplWin32@priv@sf@@AAEXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : 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)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__TrackMouseEvent@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::ProcessEvent(unsigned int,unsigned int,long)" (?ProcessEvent@WindowImplWin32@priv@sf@@AAEXIIJ@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : 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)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : 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)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__MapVirtualKeyA@8 referenced in function "private: static enum sf::Key::Code __cdecl sf::priv::WindowImplWin32::VirtualKeyCodeToSF(unsigned int,long)" (?VirtualKeyCodeToSF@WindowImplWin32@priv@sf@@CA?AW4Code@Key@3@IJ@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : 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)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : 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)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : 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)
1>D:\C++\Learning\Game\Debug\Game.exe : fatal error LNK1120: 41 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.86
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Here is what my settings look like:





And I'm using the SFML 2.0 libraries someone posted on the forum here for VC2010. Any ideas as to why it wont build?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
VC2010 & SFML 2.0
« Reply #1 on: August 17, 2010, 11:13:55 pm »
Apparently it's not linking the default Windows libraries. Try adding kernel32.lib, gdi32.lib, user32.lib. I don't remember them all, if you still have undefined references look at the MSDN to know which additional library to add.
Laurent Gomila - SFML developer

Elffus

  • Newbie
  • *
  • Posts: 13
    • View Profile
VC2010 & SFML 2.0
« Reply #2 on: August 17, 2010, 11:19:39 pm »
Ah, it unticked the inherited values option for some reason, thanks!  :D

Elffus

  • Newbie
  • *
  • Posts: 13
    • View Profile
VC2010 & SFML 2.0
« Reply #3 on: August 18, 2010, 01:35:45 am »
Sorry to double post, but I'm now experiencing trouble with "WindowSettings"

Code: [Select]
1>------ Build started: Project: Game, Configuration: Debug Win32 ------
1>Build started 18/08/2010 00:34:10.
1>InitializeBuildStatus:
1>  Touching "Debug\Game.unsuccessfulbuild".
1>ClCompile:
1>  main.cpp
1>d:\c++\learning\game\main.cpp(9): error C2039: 'WindowSettings' : is not a member of 'sf'
1>d:\c++\learning\game\main.cpp(9): error C2065: 'WindowSettings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(9): error C2146: syntax error : missing ';' before identifier 'Settings'
1>d:\c++\learning\game\main.cpp(9): error C2065: 'Settings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(10): error C2065: 'Settings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(10): error C2228: left of '.DepthBits' must have class/struct/union
1>          type is ''unknown-type''
1>d:\c++\learning\game\main.cpp(11): error C2065: 'Settings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(11): error C2228: left of '.StencilBits' must have class/struct/union
1>          type is ''unknown-type''
1>d:\c++\learning\game\main.cpp(12): error C2065: 'Settings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(12): error C2228: left of '.AntialiasingLevel' must have class/struct/union
1>          type is ''unknown-type''
1>d:\c++\learning\game\main.cpp(15): error C2065: 'Settings' : undeclared identifier
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.42
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


It errors this, from this code:

Code: [Select]
sf::WindowSettings Settings;
Settings.DepthBits = 24;
Settings.StencilBits = 8;
Settings.AntialiasingLevel = 8;

// Create the window.
sf::RenderWindow App( sf::VideoMode( 800, 600, 32 ), "Connect 4", sf::Style::Close, Settings );


When I remove the Settings however it works perfectly?  :?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
VC2010 & SFML 2.0
« Reply #4 on: August 18, 2010, 08:17:36 am »
Look at the documentation, a lot of things have changed in SFML 2.
Laurent Gomila - SFML developer

Elffus

  • Newbie
  • *
  • Posts: 13
    • View Profile
VC2010 & SFML 2.0
« Reply #5 on: August 18, 2010, 11:29:50 am »
Ah, I see, I must use ContextSettings instead. Thanks again!