我遵循了Sga的答案如何在Visual Studio 2017(C++(中使用Chromium Embedded Framework?使用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:UsersBremeyeTsourcereposcef_binary_3.3538.1849.g458cc98_windows32buildtestscefsimplecef_sandbox.lib(wmi.obj) 1
Error LNK1120 1 unresolved externals cefsimple C:UsersBremeyeTsourcereposcef_binary_3.3538.1849.g458cc98_windows32buildtestscefsimpleDebugcefsimple.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:UsersBremeyeTsourcereposcef_binary_3.3538.1849.g458cc98_windows32buildtestscefclientcef_sandbox.lib(wmi.obj) 1
Error LNK1120 1 unresolved externals cefclient C:UsersBremeyeTsourcereposcef_binary_3.3538.1849.g458cc98_windows32buildtestscefclientDebugcefclient.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:UsersBremeyeTsourcereposcef_binary_3.3538.1849.g458cc98_windows32buildtestsceftestscef_sandbox.lib(wmi.obj) 1
Error LNK1120 1 unresolved externals ceftests C:UsersBremeyeTsourcereposcef_binary_3.3538.1849.g458cc98_windows32buildtestsceftestsDebugceftests.exe
从这个问题中,我了解到它与wbemuid.lib有关。所以我添加了
$(UniversalCRT_LibraryPath_x86(..\。。\um\x86
到项目cefclient、cefssimple和ceftests的库目录,因为这是我在驱动器上找到wbemuid.lib的地方。然而,Cef库仍然没有成功编译,并显示出相同的错误。
我确实检查过我正在编译Win32版本的库,wbemuid.lib是32位版本。
我还需要做什么才能获得成功的编译和链接?
您需要链接wbemuid.lib