c++ - 如何使用 Visual Studio 2017 编译 CEF 库?
问题描述
我关注了 Sga 的回答How to use Chromium Embedded Framework with Visual Studio 2017 (C++)? 用 Visual Studio 2017 编译 Cef。但是,当我按照他的步骤 7 构建调试/发布时,我收到以下错误:
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol _CLSID_WbemLocator referenced in function "bool __cdecl base::win::CreateLocalWmiConnection(bool,class Microsoft::WRL::ComPtr<struct IWbemServices> *)" (?CreateLocalWmiConnection@win@base@@YA_N_NPAV?$ComPtr@UIWbemServices@@@WRL@Microsoft@@@Z) cefsimple C:\Users\BremeyeT\source\repos\cef_binary_3.3538.1849.g458cc98_windows32\build\tests\cefsimple\cef_sandbox.lib(wmi.obj) 1
Error LNK1120 1 unresolved externals cefsimple C:\Users\BremeyeT\source\repos\cef_binary_3.3538.1849.g458cc98_windows32\build\tests\cefsimple\Debug\cefsimple.exe 1
Error LNK2019 unresolved external symbol _CLSID_WbemLocator referenced in function "bool __cdecl base::win::CreateLocalWmiConnection(bool,class Microsoft::WRL::ComPtr<struct IWbemServices> *)" (?CreateLocalWmiConnection@win@base@@YA_N_NPAV?$ComPtr@UIWbemServices@@@WRL@Microsoft@@@Z) cefclient C:\Users\BremeyeT\source\repos\cef_binary_3.3538.1849.g458cc98_windows32\build\tests\cefclient\cef_sandbox.lib(wmi.obj) 1
Error LNK1120 1 unresolved externals cefclient C:\Users\BremeyeT\source\repos\cef_binary_3.3538.1849.g458cc98_windows32\build\tests\cefclient\Debug\cefclient.exe 1
Error LNK2019 unresolved external symbol _CLSID_WbemLocator referenced in function "bool __cdecl base::win::CreateLocalWmiConnection(bool,class Microsoft::WRL::ComPtr<struct IWbemServices> *)" (?CreateLocalWmiConnection@win@base@@YA_N_NPAV?$ComPtr@UIWbemServices@@@WRL@Microsoft@@@Z) ceftests C:\Users\BremeyeT\source\repos\cef_binary_3.3538.1849.g458cc98_windows32\build\tests\ceftests\cef_sandbox.lib(wmi.obj) 1
Error LNK1120 1 unresolved externals ceftests C:\Users\BremeyeT\source\repos\cef_binary_3.3538.1849.g458cc98_windows32\build\tests\ceftests\Debug\ceftests.exe
从这个问题我了解到它与 wbemuuid.lib 有关。所以我加了
$(UniversalCRT_LibraryPath_x86)..\..\um\x86
到项目 cefclient、cefsimple 和 ceftests 的库目录,因为这是我在驱动器上找到 wbemuuid.lib 的地方。但是 Cef 库仍然没有成功编译并显示相同的错误。
我确实检查了我正在编译库的 Win32 版本,并且 wbemuuid.lib 是 32 位版本。
我还需要做什么才能获得成功的编译和链接?
解决方案
您需要与 wbemuuid.lib 链接
推荐阅读
- php - 您是否需要所有以前的历史值来计算 EMA?
- vim - 使用惰性量词搜索
- powershell - 取变量 A 的名称并将其添加到变量 B 的名称中
- postgresql - PyCharm 有过时的 SQL 方言?
- c# - 导航按钮取决于其他 ViewModel 的条件
- android - URL字符串无法在android 11上运行
- javascript - 将 map 方法与 react 一起使用时出现问题(posts.map 不是函数)
- postgresql - 如何在没有分区的情况下列出postgres中的所有表
- html - 具有 1x1、2x1 和 1x2 项目和持久纵横比的响应式网格
- reactjs - 对单个元素反应可拖动