我遵循Sga的答案How to use Chromium Embedded Framework with Visual Studio 2017 (C++)?,用VisualStudio2017编译Cef。但是,当我遵循他的步骤7. Build /Release时,我得到了以下错误:
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我从this question了解到这与wbemuuid.lib有关。所以我加入了
$(UniversalCRT_LibraryPath_x86)....\um\x86
到项目cefclient、cefsimple和ceftest的库目录,因为这是我在驱动器中找到wbemuuid.lib的地方。然而,Cef库仍未成功编译,并显示相同的错误。
我确实检查了我正在编译库的Win32版本,而wbemuuid.lib是32位版本。
为了获得一个成功的编译和链接,我还需要做什么呢?
发布于 2018-12-01 18:22:54
您需要链接到wbemuuid.lib
https://stackoverflow.com/questions/53185835
复制相似问题