Visual studio 2012 error LNK2019: unresolved external symbol, linking with static lib that is working

StackOverflow https://stackoverflow.com/questions/23408384

  •  13-07-2023
  •  | 
  •  

Question

I'm trying to compile and link SDL2 + urho3d + QT. Now SDL and urho3d are static lib's that are working great and compiles fine in some examples but when I try to compile all of them the compilation is passing throw fine but I got alot of linker errors.

Here are the files I tried to compile: SDL2+QT+urho3d

And here are the linker errors:

1>     Creating library debug\\UDK.lib and object debug\\UDK.exp
1>Urho3D_d.lib(Timer.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "public: unsigned int __thiscall Urho3D::Timer::GetMSec(bool)" (?GetMSec@Timer@Urho3D@@QAEI_N@Z)
1>Urho3D_d.lib(SDL_systimer.obj) : error LNK2001: unresolved external symbol __imp__timeGetTime@0
1>Urho3D_d.lib(Timer.obj) : error LNK2019: unresolved external symbol __imp__timeBeginPeriod@4 referenced in function "public: void __thiscall Urho3D::Time::SetTimerPeriod(unsigned int)" (?SetTimerPeriod@Time@Urho3D@@QAEXI@Z)
1>Urho3D_d.lib(SDL_systimer.obj) : error LNK2001: unresolved external symbol __imp__timeBeginPeriod@4
1>Urho3D_d.lib(Timer.obj) : error LNK2019: unresolved external symbol __imp__timeEndPeriod@4 referenced in function "public: void __thiscall Urho3D::Time::SetTimerPeriod(unsigned int)" (?SetTimerPeriod@Time@Urho3D@@QAEXI@Z)
1>Urho3D_d.lib(SDL_systimer.obj) : error LNK2001: unresolved external symbol __imp__timeEndPeriod@4
1>Urho3D_d.lib(OGLGraphics.obj) : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function "public: void __thiscall Urho3D::Graphics::Clear(unsigned int,class Urho3D::Color const &,float,unsigned int)" (?Clear@Graphics@Urho3D@@QAEXIABVColor@2@MI@Z)
1>Urho3D_d.lib(OGLGraphics.obj) : error LNK2019: unresolved external symbol __imp__glClipPlane@8 referenced in function "public: void __thiscall Urho3D::Graphics::SetClipPlane(bool,class Urho3D::Plane const &,class Urho3D::Matrix3x4 const &,class Urho3D::Matrix4 const &)" (?SetClipPlane@Graphics@Urho3D@@QAEX_NABVPlane@2@ABVMatrix3x4@2@ABVMatrix4@2@@Z)
1>Urho3D_d.lib(OGLGraphics.obj) : error LNK2019: unresolved external symbol __imp__glDrawBuffer@4 referenced in function "private: void __thiscall Urho3D::Graphics::CommitFramebuffer(void)" (?CommitFramebuffer@Graphics@Urho3D@@AAEXXZ)
1>Urho3D_d.lib(OGLGraphics.obj) : error LNK2019: unresolved external symbol __imp__glPolygonMode@8 referenced in function "public: void __thiscall Urho3D::Graphics::SetFillMode(enum Urho3D::FillMode)" (?SetFillMode@Graphics@Urho3D@@QAEXW4FillMode@2@@Z)
1>Urho3D_d.lib(OGLGraphics.obj) : error LNK2019: unresolved external symbol __imp__glReadBuffer@4 referenced in function "private: void __thiscall Urho3D::Graphics::CommitFramebuffer(void)" (?CommitFramebuffer@Graphics@Urho3D@@AAEXXZ)
1>Urho3D_d.lib(glew.obj) : error LNK2019: unresolved external symbol __imp__wglGetCurrentDC@0 referenced in function _wglewGetExtension@4
1>Urho3D_d.lib(glew.obj) : error LNK2019: unresolved external symbol __imp__wglGetProcAddress@4 referenced in function __glewInit_GL_VERSION_1_2
1>Urho3D_d.lib(OGLTexture2D.obj) : error LNK2019: unresolved external symbol __imp__glGetTexImage@20 referenced in function "public: bool __thiscall Urho3D::Texture2D::GetData(unsigned int,void *)const " (?GetData@Texture2D@Urho3D@@QBE_NIPAX@Z)
1>Urho3D_d.lib(OGLTexture3D.obj) : error LNK2001: unresolved external symbol __imp__glGetTexImage@20
1>Urho3D_d.lib(OGLTextureCube.obj) : error LNK2001: unresolved external symbol __imp__glGetTexImage@20
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoSizeA@8 referenced in function _IME_GetId
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoA@16 referenced in function _IME_GetId
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _VerQueryValueA@16 referenced in function _IME_GetId
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmGetIMEFileNameA@12 referenced in function _IME_SetupAPI
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmGetContext@4 referenced in function _IME_HandleMessage
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmReleaseContext@8 referenced in function _IME_HandleMessage
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmAssociateContext@8 referenced in function _IME_HandleMessage
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmGetCompositionStringW@16 referenced in function _IME_GetCompositionString
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmSetCompositionStringW@24 referenced in function _IME_ClearComposition
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmGetCandidateListW@16 referenced in function _IME_GetCandidateList
1>Urho3D_d.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmNotifyIME@16 referenced in function _IME_ClearComposition
1>debug\\UDK.exe : fatal error LNK1120: 22 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I set all the preproccess flags and all of them compiles as Multi thread DDL's.

Was it helpful?

Solution

Add winmm.lib to your project setting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top