Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 242
user63898 Avatar asked May 01 '14 13:05

user63898


People also ask

How to fix LNK2019 error in Visual Studio?

There are a couple of ways to resolve this issue. The method we recommend is to rebuild the legacy library with your current version of Visual Studio. Make sure the library code uses the standard headers for the definitions of the *printf* and *scanf* functions that caused the errors.

How to resolve linking errors in Visual Studio?

You will need to add them manually to your Visual Studio project in order to resolve all the symbols. In order to include the required libraries, you will need to add them under Project -> Properties -> Linker -> Input -> Additional dependencies: For example: mclmcrrt.

What does LNK2019 mean?

LNK2019 can occur when a declaration exists in a header file, but no matching definition is implemented. For member functions or static data members, the implementation must include the class scope selector. For an example, see Missing Function Body or Variable.


1 Answers

Add winmm.lib to your project setting.

like image 104
niketan Avatar answered Oct 16 '22 11:10

niketan