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

Author Topic: Unresolved External Symbols  (Read 5290 times)

0 Members and 1 Guest are viewing this topic.

Omikron

  • Newbie
  • *
  • Posts: 8
    • View Profile
Unresolved External Symbols
« on: October 02, 2016, 09:49:14 pm »
Trying to set up SFML on a new PC. I've used it successfully in the past but this time it's not working. All I did was follow the tutorial using the 32bit download on MSVS14.0. There are more errors when building debug than building for release.

Severity   Code   Description   Project   File   Line   Suppression State
Error   LNK2019   unresolved external symbol ___CxxFrameHandler3 referenced in function __ehhandler$??0locale@std@@QAE@XZ   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\main.obj   1   
Error   LNK2019   unresolved external symbol __CrtDbgReport referenced in function __CRT_RTC_INIT   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_init_.obj)   1   
Error   LNK2019   unresolved external symbol __CrtDbgReportW referenced in function __CRT_RTC_INITW   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_init_.obj)   1   
Error   LNK2019   unresolved external symbol ___stdio_common_vsprintf_s referenced in function __vsprintf_s_l   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_error_.obj)   1   
Error   LNK2019   unresolved external symbol __wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_pdblkup_.obj)   1   
Error   LNK2019   unresolved external symbol __wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_pdblkup_.obj)   1   
Error   LNK2019   unresolved external symbol _wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_pdblkup_.obj)   1   
Error   LNK2019   unresolved external symbol ___vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_pdblkup_.obj)   1   
Error   LNK2019   unresolved external symbol ___vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_pdblkup_.obj)   1   
Error   LNK2019   unresolved external symbol ___vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_pdblkup_.obj)   1   
Error   LNK2019   unresolved external symbol __except_handler4_common referenced in function __except_handler4   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\MSVCRTD.lib(_chandler4gs_.obj)   1   


Only the following for release:
Severity   Code   Description   Project   File   Line   Suppression State
Error   LNK2001   unresolved external symbol ___std_terminate   SFMLProject1   c:\Users\Greg\documents\visual studio 2015\Projects\SFMLProject1\SFMLProject1\main.obj   1   

These are the additional dependencies:
sfml-graphics.lib;sfml-window.lib;sfml-audio.lib;sfml-network.lib;sfml-system.lib;opengl32.lib;freetype.lib;jpeg.lib;winmm.lib;flac.lib;vorbisenc.lib;vorbisfile.lib;vorbis.lib;ogg.lib;ws2_32.lib;

I've checked the input & lib directories. The code is copied & pasted from the tutorial. I've started again from scratch multiple times. So, I've tried everything I can think of. Help would be appreciated!

Yohdu

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: Unresolved External Symbols
« Reply #1 on: October 03, 2016, 10:27:44 am »
Others may have a better answer than mine, but here are some questions/remarks:

- stupid question: are you able to compile properly a simple program which does not use sfml ?

- in debug mode, did you link the libraries with the "-d" suffixe ?

- what kind of project did you create in Visual Studio ? Console or Windows program ?
        => I always link the sfml-main[-d].lib library in my project, even though in a console program I don't have to.

- if you are linking dynamically, the libraries: opengl32.lib; freetype.lib; jpeg.lib; winmm.lib; flac.lib; vorbisenc.lib; vorbisfile.lib; vorbis.lib; ogg.lib; ws2_32.lib are useless (only use those with the sfml prefix).

- are you absolutely sure you downloaded the MSVC14 pre-compiled binaries for 32 bits windows ?

- did you try creating a new fresh project? Once it happens to me that a one of my project got corrupted.

Hope it helps  :-\

Reborn

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Unresolved External Symbols
« Reply #2 on: October 03, 2016, 09:51:15 pm »
This error arises when you link wrong msvc libraries to a executable.
May be this helps:
http://hintslibrary.blogspot.de/2014/02/error-lnk2001-unresolved-external.html

Omikron

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Unresolved External Symbols
« Reply #3 on: October 06, 2016, 04:44:41 pm »
Instead of linking sfml-main.lib I had set main as the entry point which caused all the linker errors. Thanks for the help.