Visual Studio 2012错误LNK2019:未解析的外部符号,链接正在运行的静态库

时间:2014-05-01 13:11:13

标签: c++ qt sdl static-linking

我正在尝试编译和链接SDL2 + urho3d + QT。现在SDL和urho3d是静态的lib,它们工作得很好并且在一些例子中编译得很好但是当我尝试编译所有这些时,编译传递抛出罚款但是我有很多链接器错误。

以下是我尝试编译的文件:SDL2+QT+urho3d

以下是链接器错误:

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 ==========

我设置了所有preproccess标志,并且所有标志都编译为多线程DDL。

1 个答案:

答案 0 :(得分:6)

将winmm.lib添加到项目设置中。