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

Author Topic: VS2013 linker problems  (Read 3934 times)

0 Members and 1 Guest are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
VS2013 linker problems
« on: October 06, 2014, 03:31:06 pm »
Hi

Using the latest SFML built with VS2013, when I link my game project I get lots of unresolved externals, stuff like this:

Error   3   error LNK2001: unresolved external symbol __imp__glBindTexture@8   C:\Projects\game\sfml-graphics-s-d.lib(Texture.obj)

Error   7   error LNK2001: unresolved external symbol __imp__glGetIntegerv@8   C:\Projects\game\sfml-graphics-s-d.lib(Texture.obj)

Error   139   error LNK2019: unresolved external symbol __imp__timeGetDevCaps@8 referenced in function "void __cdecl sf::priv::sleepImpl(class sf::Time)" (?sleepImpl@priv@sf@@YAXVTime@2@@Z)   C:\Projects\game\sfml-system-s-d.lib(SleepImpl.obj)


...I have built the SFML libraries as static....so I think this is a problem with the libraries I've build rather than the game. What have I missed.....?

Thanks
Ed
SFML 2.1

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: VS2013 linker problems
« Reply #2 on: October 06, 2014, 05:06:58 pm »
Thanks for the link, seems quite a lot has changed since I last built SFML about 12 months ago! I have added all .lib files necessary, and now down to 8 errors....so what is missing?!

Error   5   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)   C:\Projects\game3\sfml-window-s-d.lib(WglContext.obj)

Error   4   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)   C:\Projects\game\sfml-window-s-d.lib(WglContext.obj)

Error   8   error LNK2019: unresolved external symbol __imp__RegQueryValueExW@24 referenced in function "class sf::String __cdecl `anonymous namespace'::getDeviceName(unsigned int,struct tagJOYCAPSW)" (?getDeviceName@?A0x53009e8c@@YA?AVString@sf@@IUtagJOYCAPSW@@@Z)   C:\Projects\game\sfml-window-s-d.lib(JoystickImpl.obj)

Error   7   error LNK2019: unresolved external symbol __imp__RegOpenKeyExW@20 referenced in function "class sf::String __cdecl `anonymous namespace'::getDeviceName(unsigned int,struct tagJOYCAPSW)" (?getDeviceName@?A0x53009e8c@@YA?AVString@sf@@IUtagJOYCAPSW@@@Z)   C:\Projects\game\sfml-window-s-d.lib(JoystickImpl.obj)

Error   6   error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function "class sf::String __cdecl `anonymous namespace'::getDeviceName(unsigned int,struct tagJOYCAPSW)" (?getDeviceName@?A0x53009e8c@@YA?AVString@sf@@IUtagJOYCAPSW@@@Z)   C:\Projects\game\sfml-window-s-d.lib(JoystickImpl.obj)

Error   3   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)   C:\Projects\game\sfml-window-s-d.lib(WglContext.obj)

Error   2   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)   C:\Projects\game\sfml-window-s-d.lib(WglContext.obj)


Here's all my .lib files:
C:\SFML\SFML21_031014\extlibs\libs-msvc\x86\freetype.lib
C:\SFML\SFML21_031014\extlibs\libs-msvc\x86\glew.lib
C:\SFML\SFML21_031014\extlibs\libs-msvc\x86\jpeg.lib
C:\SFML\SFML21_031014\extlibs\libs-msvc\x86\openal32.lib
C:\SFML\SFML21_031014\extlibs\libs-msvc\x86\sndfile.lib
C:\SFML\SFML21_031014\lib\debug\sfml-graphics-s-d.lib
C:\SFML\SFML21_031014\lib\debug\sfml-window-s-d.lib
C:\SFML\SFML21_031014\lib\debug\sfml-system-s-d.lib
C:\SFML\SFML21_031014\lib\debug\sfml-audio-s-d.lib
C:\SFML\SFML21_031014\lib\debug\sfml-main-d.lib
C:\SFML\SFML21_031014\lib\debug\sfml-network-s-d.lib
winmm.lib
opengl32.lib
ws2_32.lib
Kernel32.lib
User32.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib

Thanks again :)
SFML 2.1

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: VS2013 linker problems
« Reply #3 on: October 06, 2014, 05:18:34 pm »
Strange... those symbols are supposed to be in gdi32.lib and advapi32.lib. Did you try rebuilding from scratch? If that doesn't help, you could try inspecting the build output. Often times, Visual Studio likes to play tricks on the unknowing ::).
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: VS2013 linker problems
« Reply #4 on: October 06, 2014, 05:31:43 pm »
Ah ha!

So adding gdi32.lib and advapi32.lib to my linker input worked - for some reason, even though gdi32.lib was already in the "inherited" area it didn't work....

Thanks for your help, game is now up and running :)
SFML 2.1