VS2013中未解析的外部符号

时间:2016-10-17 23:33:17

标签: c++ curl visual-studio-2012 boost

我尝试使用Cmake为Visual Studio 2013生成EmulationStation解决方案。

ES有很多依赖项:Boost,Eigen,cURL,FreeImage,SDL和FreeType2。根据项目维基,我必须编译Boost,FreeType2和cURL(不能使用预编译)。帮助主题也说要编译FreeImage。

所以,在下载了所有这些并放入文件夹"依赖项":

之后
  • Boost:运行bootstrap.bat,然后运行cmd admin:" b2 toolset = msvc-12.0 address-model = 32 --build-dir = build \ x86 install --prefix =&# 34; C:\ Program Files(x86)\ Boost" -j8"

  • FreeImage:刚刚打开VS解决方案,并在Debug和Release中编译。

  • cURL:在Debug和Release中编译了libcurl。

  • FreeType:从VS10更新,然后在Debug和Release中编译,都是多线程的。

在Cmake中,我指出了所请求的库和文件夹,并生成了它。但VS不会编译,有大量未解决的外部符号"错误:

> 5>MSVCRTD.lib(MSVCR120D.dll) : error LNK2005: ___iob_func already
> defined in es-cored.lib(Util.obj) 5>     Creating library
> C:/es_project/EmulationStation-master/Debug/emulationstation.lib and
> object
> C:/es_project/EmulationStation-master/Debug/emulationstation.exp
> 5>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'libcmt.lib'
> conflicts with use of other libs; use /NODEFAULTLIB:library 5>main.obj
> : error LNK2019: unresolved external symbol _SDL_JoystickEventState
> referenced in function _SDL_main 5>es-cored.lib(InputManager.obj) :
> error LNK2001: unresolved external symbol _SDL_JoystickEventState
> 5>main.obj : error LNK2019: unresolved external symbol _SDL_PollEvent
> referenced in function _SDL_main 5>main.obj : error LNK2019:
> unresolved external symbol _SDL_PushEvent referenced in function
> "public: void __thiscall
> <lambda_e5a360d73d66414339214600a80a7ef8>::operator()(void)const "
> (??R<lambda_e5a360d73d66414339214600a80a7ef8>@@QBEXXZ) 5>GuiMenu.obj :
> error LNK2001: unresolved external symbol _SDL_PushEvent
> 5>es-cored.lib(platform.obj) : error LNK2001: unresolved external
> symbol _SDL_PushEvent 5>es-cored.lib(InputManager.obj) : error
> LNK2001: unresolved external symbol _SDL_PushEvent 5>main.obj : error
> LNK2019: unresolved external symbol _SDL_GetTicks referenced in
> function _SDL_main 5>main.obj : error LNK2019: unresolved external
> symbol _SDL_Delay referenced in function _SDL_main 5>GuiMenu.obj :
> error LNK2019: unresolved external symbol _SDL_GetNumVideoDisplays
> referenced in function "public: void __thiscall
> <lambda_fc850361ed8275e134acc307a7d99a0e>::operator()(void)const "
> (??R<lambda_fc850361ed8275e134acc307a7d99a0e>@@QBEXXZ) 5>GuiMenu.obj :
> error LNK2019: unresolved external symbol _SDL_GetDisplayName
> referenced in function "public: void __thiscall
> <lambda_fc850361ed8275e134acc307a7d99a0e>::operator()(void)const "
> (??R<lambda_fc850361ed8275e134acc307a7d99a0e>@@QBEXXZ)
> 5>IGameListView.obj : error LNK2019: unresolved external symbol
> _SDL_GetModState referenced in function "public: virtual bool __thiscall IGameListView::input(class InputConfig *,struct Input)" (?input@IGameListView@@UAE_NPAVInputConfig@@UInput@@@Z)
> 5>SystemView.obj : error LNK2001: unresolved external symbol
> _SDL_GetModState 5>es-cored.lib(Window.obj) : error LNK2001: unresolved external symbol _SDL_GetModState
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_IsTextInputActive referenced in function "public: bool
> __thiscall InputManager::parseEvent(union SDL_Event const &,class Window *)"
> (?parseEvent@InputManager@@QAE_NABTSDL_Event@@PAVWindow@@@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_NumJoysticks referenced in function "private: void
> __thiscall InputManager::addJoystickByDeviceIndex(int)" (?addJoystickByDeviceIndex@InputManager@@AAEXH@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_JoystickOpen referenced in function "private: void
> __thiscall InputManager::addJoystickByDeviceIndex(int)" (?addJoystickByDeviceIndex@InputManager@@AAEXH@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_JoystickName referenced in function "private: void
> __thiscall InputManager::addJoystickByDeviceIndex(int)" (?addJoystickByDeviceIndex@InputManager@@AAEXH@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_JoystickGetGUID referenced in function "private: void
> __thiscall InputManager::addJoystickByDeviceIndex(int)" (?addJoystickByDeviceIndex@InputManager@@AAEXH@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_JoystickGetGUIDString referenced in function "private:
> void __thiscall InputManager::addJoystickByDeviceIndex(int)"
> (?addJoystickByDeviceIndex@InputManager@@AAEXH@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_JoystickInstanceID referenced in function "private: void
> __thiscall InputManager::addJoystickByDeviceIndex(int)" (?addJoystickByDeviceIndex@InputManager@@AAEXH@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_JoystickNumAxes referenced in function "private: void
> __thiscall InputManager::addJoystickByDeviceIndex(int)" (?addJoystickByDeviceIndex@InputManager@@AAEXH@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_JoystickNumButtons referenced in function "public: int
> __thiscall InputManager::getButtonCountByDevice(int)" (?getButtonCountByDevice@InputManager@@QAEHH@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_JoystickClose referenced in function "private: void
> __thiscall InputManager::removeJoystickByJoystickID(int)" (?removeJoystickByJoystickID@InputManager@@AAEXH@Z)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_SetHint referenced in function "public: void __thiscall
> InputManager::init(void)" (?init@InputManager@@QAEXXZ)
> 5>es-cored.lib(InputManager.obj) : error LNK2019: unresolved external
> symbol _SDL_InitSubSystem referenced in function "public: void
> __thiscall InputManager::init(void)" (?init@InputManager@@QAEXXZ) 5>es-cored.lib(AudioManager.obj) : error LNK2001: unresolved external
> symbol _SDL_InitSubSystem 5>es-cored.lib(InputManager.obj) : error
> LNK2019: unresolved external symbol _SDL_QuitSubSystem referenced in
> function "public: void __thiscall InputManager::deinit(void)"
> (?deinit@InputManager@@QAEXXZ) 5>es-cored.lib(AudioManager.obj) :
> error LNK2001: unresolved external symbol _SDL_QuitSubSystem
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_GetError referenced in function "bool __cdecl
> Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(AudioManager.obj) : error LNK2001: unresolved external
> symbol _SDL_GetError 5>es-cored.lib(Sound.obj) : error LNK2001:
> unresolved external symbol _SDL_GetError
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_CreateRGBSurfaceFrom referenced in function "bool
> __cdecl Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_FreeSurface referenced in function "bool __cdecl
> Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_GetDesktopDisplayMode referenced in function
> "bool __cdecl Renderer::createSurface(void)"
> (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_CreateWindow referenced in function "bool __cdecl
> Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_SetWindowIcon referenced in function "bool
> __cdecl Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_DestroyWindow referenced in function "void
> __cdecl Renderer::destroySurface(void)" (?destroySurface@Renderer@@YAXXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_GL_SetAttribute referenced in function "bool
> __cdecl Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_GL_CreateContext referenced in function "bool
> __cdecl Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_GL_SetSwapInterval referenced in function "bool
> __cdecl Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_GL_SwapWindow referenced in function "void
> __cdecl Renderer::swapBuffers(void)" (?swapBuffers@Renderer@@YAXXZ) 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_GL_DeleteContext referenced in function "void
> __cdecl Renderer::destroySurface(void)" (?destroySurface@Renderer@@YAXXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_ShowCursor referenced in function "bool __cdecl
> Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_Init referenced in function "bool __cdecl
> Renderer::createSurface(void)" (?createSurface@Renderer@@YA_NXZ)
> 5>es-cored.lib(Renderer_init_sdlgl.obj) : error LNK2019: unresolved
> external symbol _SDL_Quit referenced in function "void __cdecl
> Renderer::destroySurface(void)" (?destroySurface@Renderer@@YAXXZ)
> 5>es-cored.lib(AudioManager.obj) : error LNK2019: unresolved external
> symbol _SDL_memset referenced in function "private: static void
> __cdecl AudioManager::mixAudio(void *,unsigned char *,int)" (?mixAudio@AudioManager@@CAXPAXPAEH@Z)
> 5>es-cored.lib(AudioManager.obj) : error LNK2019: unresolved external
> symbol _SDL_OpenAudio referenced in function "public: void __thiscall
> AudioManager::init(void)" (?init@AudioManager@@QAEXXZ)
> 5>es-cored.lib(AudioManager.obj) : error LNK2019: unresolved external
> symbol _SDL_PauseAudio referenced in function "private: static void
> __cdecl AudioManager::mixAudio(void *,unsigned char *,int)" (?mixAudio@AudioManager@@CAXPAXPAEH@Z)
> 5>es-cored.lib(AudioManager.obj) : error LNK2019: unresolved external
> symbol _SDL_MixAudio referenced in function "private: static void
> __cdecl AudioManager::mixAudio(void *,unsigned char *,int)" (?mixAudio@AudioManager@@CAXPAXPAEH@Z)
> 5>es-cored.lib(AudioManager.obj) : error LNK2019: unresolved external
> symbol _SDL_CloseAudio referenced in function "public: void __thiscall
> AudioManager::deinit(void)" (?deinit@AudioManager@@QAEXXZ)
> 5>es-cored.lib(HttpReq.obj) : error LNK2019: unresolved external
> symbol __imp__curl_easy_strerror referenced in function "public:
> __thiscall HttpReq::HttpReq(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"
> (??0HttpReq@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> 5>es-cored.lib(HttpReq.obj) : error LNK2019: unresolved external
> symbol __imp__curl_easy_init referenced in function "public:
> __thiscall HttpReq::HttpReq(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"
> (??0HttpReq@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> 5>es-cored.lib(HttpReq.obj) : error LNK2019: unresolved external
> symbol __imp__curl_easy_setopt referenced in function "public:
> __thiscall HttpReq::HttpReq(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"
> (??0HttpReq@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> 5>es-cored.lib(HttpReq.obj) : error LNK2019: unresolved external
> symbol __imp__curl_easy_cleanup referenced in function "public:
> __thiscall HttpReq::~HttpReq(void)" (??1HttpReq@@QAE@XZ) 5>es-cored.lib(HttpReq.obj) : error LNK2019: unresolved external
> symbol __imp__curl_multi_init referenced in function "void __cdecl
> `dynamic initializer for 'private: static void *
> HttpReq::s_multi_handle''(void)"
> (??__E?s_multi_handle@HttpReq@@0PAXA@@YAXXZ)
> 5>es-cored.lib(HttpReq.obj) : error LNK2019: unresolved external
> symbol __imp__curl_multi_add_handle referenced in function "public:
> __thiscall HttpReq::HttpReq(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"
> (??0HttpReq@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> 5>es-cored.lib(HttpReq.obj) : error LNK2019: unresolved external
> symbol __imp__curl_multi_remove_handle referenced in function "public:
> __thiscall HttpReq::~HttpReq(void)" (??1HttpReq@@QAE@XZ) 5>es-cored.lib(HttpReq.obj) : error LNK2019: unresolved external
> symbol __imp__curl_multi_perform referenced in function "public: enum
> HttpReq::Status __thiscall HttpReq::status(void)"
> (?status@HttpReq@@QAE?AW4Status@1@XZ) 5>es-cored.lib(HttpReq.obj) :
> error LNK2019: unresolved external symbol __imp__curl_multi_info_read
> referenced in function "public: enum HttpReq::Status __thiscall
> HttpReq::status(void)" (?status@HttpReq@@QAE?AW4Status@1@XZ)
> 5>es-cored.lib(HttpReq.obj) : error LNK2019: unresolved external
> symbol __imp__curl_multi_strerror referenced in function "public:
> __thiscall HttpReq::HttpReq(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"
> (??0HttpReq@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> 5>es-cored.lib(Sound.obj) : error LNK2019: unresolved external symbol
> _SDL_RWFromFile referenced in function "public: void __thiscall Sound::init(void)" (?init@Sound@@QAEXXZ) 5>es-cored.lib(Sound.obj) :
> error LNK2019: unresolved external symbol _SDL_LoadWAV_RW referenced
> in function "public: void __thiscall Sound::init(void)"
> (?init@Sound@@QAEXXZ) 5>es-cored.lib(Sound.obj) : error LNK2019:
> unresolved external symbol _SDL_FreeWAV referenced in function
> "public: void __thiscall Sound::init(void)" (?init@Sound@@QAEXXZ)
> 5>es-cored.lib(Sound.obj) : error LNK2019: unresolved external symbol
> _SDL_BuildAudioCVT referenced in function "public: void __thiscall Sound::init(void)" (?init@Sound@@QAEXXZ) 5>es-cored.lib(Sound.obj) :
> error LNK2019: unresolved external symbol _SDL_ConvertAudio referenced
> in function "public: void __thiscall Sound::init(void)"
> (?init@Sound@@QAEXXZ) 5>es-cored.lib(Sound.obj) : error LNK2019:
> unresolved external symbol _SDL_LockAudio referenced in function
> "public: void __thiscall Sound::init(void)" (?init@Sound@@QAEXXZ)
> 5>es-cored.lib(Sound.obj) : error LNK2019: unresolved external symbol
> _SDL_UnlockAudio referenced in function "public: void __thiscall Sound::init(void)" (?init@Sound@@QAEXXZ)
> 5>es-cored.lib(GuiInputConfig.obj) : error LNK2019: unresolved
> external symbol _SDL_GetKeyName referenced in function "public: class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > __thiscall Input::string(void)"
> (?string@Input@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
> 5>es-cored.lib(TextEditComponent.obj) : error LNK2019: unresolved
> external symbol _SDL_StartTextInput referenced in function "private:
> void __thiscall TextEditComponent::startEditing(void)"
> (?startEditing@TextEditComponent@@AAEXXZ)
> 5>es-cored.lib(TextEditComponent.obj) : error LNK2019: unresolved
> external symbol _SDL_StopTextInput referenced in function "private:
> void __thiscall TextEditComponent::stopEditing(void)"
> (?stopEditing@TextEditComponent@@AAEXXZ)
> 5>C:\es_project\EmulationStation-master\Debug\emulationstation.exe :
> fatal error LNK1120: 61 unresolved externals 6>------ Rebuild All
> started: Project: ALL_BUILD, Configuration: Debug Win32 ------ 6> 
> Building Custom Rule
> C:/es_project/EmulationStation-master/CMakeLists.txt 6>  CMake does
> not need to re-run because
> C:\es_project\build\CMakeFiles\generate.stamp is up-to-date.
> ========== Rebuild All: 5 succeeded, 1 failed, 0 skipped ==========

Cmake输出:

enter image description here

VS

enter image description here

关于我做错了什么的提示?

0 个答案:

没有答案