简体   繁体   English

如何使用Visual Studio 2017编译CEF库?

[英]How can I compile CEF library with Visual Studio 2017?

I followed Sga's answer How to use Chromium Embedded Framework with Visual Studio 2017 (C++)? 我遵循了Sga的回答如何在Visual Studio 2017(C ++)中使用Chromium嵌入式框架? to compile Cef with Visual Studio 2017. However, when I follow his step 7. Build Debug/Release, I am getting the following errors: 使用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

From this question I learned that it has to do with wbemuuid.lib. 这个问题中,我了解到它与wbemuuid.lib有关。 So I added 所以我加了

$(UniversalCRT_LibraryPath_x86)..\\..\\um\\x86 $(UniversalCRT_LibraryPath_x86).. \\ .. \\ um \\ x86

to the Library Directories of the projects cefclient, cefsimple and ceftests, because this is where I found wbemuuid.lib on my drive. 到项目cefclient,cefsimple和ceftests的库目录,因为这是在驱动器上找到wbemuuid.lib的地方。 However the Cef library still does not compile successfully and shows the same errors. 但是,Cef库仍然无法成功编译并显示相同的错误。

I did check that I am compiling the Win32 version of the library and the wbemuuid.lib is the 32 bit version. 我确实检查过我是否正在编译该库的Win32版本,而wbemuuid.lib是32位版本。

What else do I need to do to get a sucessful compile and link? 要成功编译和链接,我还需要做什么?

您需要与wbemuuid.lib链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM