Link error in SDL when building ogre deps with MSVC in debug

Problems building or running the engine, queries about how to use features etc.
Post Reply
yaron_ct
Gnoblar
Posts: 24
Joined: Tue Jan 06, 2015 10:32 pm
x 2

Link error in SDL when building ogre deps with MSVC in debug

Post by yaron_ct »

Hi,

I get the following link erros when trying to build the ogre dependencies in debug with MSVC 2015 on Windows 7 x64:

Code: Select all

      Creating library C:/Users/YaronCT/build/ogre_deps/default/src/SDL2-prefix/src/SDL2-build/Debug/SDL2.lib and object C:/Users/YaronCT/build/ogre_deps/default/src/SDL2-prefix/src/SDL2-build/Debug/SDL2.exp
MSVCRTD.lib(_init_.obj) : error LNK2019: unresolved external symbol _CrtDbgReport referenced in function _CRT_RTC_INIT [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
MSVCRTD.lib(_init_.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function _CRT_RTC_INITW [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
MSVCRTD.lib(_error_.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf_s referenced in function _vsprintf_s_l [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
MSVCRTD.lib(_error_.obj) : error LNK2001: unresolved external symbol __C_specific_handler [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol _wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z) [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol _wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z) [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z) [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ) [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ) [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ) [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\Debug\SDL2.dll : fatal error LNK1120: 10 unresolved externals [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj] [C:\Users\YaronCT\build\ogre_deps\default\src\SDL2.vcxproj]
  Done Building Project "C:\Users\YaronCT\build\ogre_deps\default\src\SDL2-prefix\src\SDL2-build\SDL2.vcxproj" (default targets) -- FAILED.
As u can c, the errors are when linking SDL. Release build works fine though.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Link error in SDL when building ogre deps with MSVC in d

Post by c6burns »

For some reason, you are not linking against the new debug CRT (which is not more than just MSVCRTD) . See:
http://stackoverflow.com/questions/3357 ... t-building

Are you trying to do something crazy like build universal apps in Win7? Because you will be missing the part of the CRT that comes in the Win10 SDK, will you not? I use 2013 in Win7 and 2015 in Win10 and I've never seen this myself. Strange it only happens in debug.
yaron_ct
Gnoblar
Posts: 24
Joined: Tue Jan 06, 2015 10:32 pm
x 2

Re: Link error in SDL when building ogre deps with MSVC in d

Post by yaron_ct »

That has fixed it, than'x a lot! I wonder why it happens though..
Post Reply