MicrosoftEdge / WebView2Samples

Microsoft Edge WebView2 samples
863 stars 466 forks source link

Build error in Windows Implementation library resource.h #108

Open iambar opened 2 years ago

iambar commented 2 years ago

Hi,

I'm getting the following build error when trying to build WebView2GettingStarted (Win32): 1>HelloWebView.cpp 1>c:\projects\webview2samples-master\gettingstartedguides\win32_gettingstarted\packages\microsoft.windows.implementationlibrary.1.0.210930.1\include\wil\resource.h(2543): error C2440: 'specialization': cannot convert from 'void (__cdecl *)(HANDLE) noexcept' to 'unknown-type' 1>c:\projects\webview2samples-master\gettingstartedguides\win32_gettingstarted\packages\microsoft.windows.implementationlibrary.1.0.210930.1\include\wil\resource.h(2543): note: Context does not allow for disambiguation of overloaded function

I'm using VS2017 15.9.39 Windows SDK version 10.0.17763.0 Platform Toolset v141 (I changed it from v142 for VS2017). Release/x64

I installed the latest versions of WIL and WebView2 using the NuGet package manager.

Is there something else missing in order to build on VS2017?

gzg0612 commented 2 years ago

I also have the same problem hao to fix it

Serif-NNR commented 2 years ago

@iambar and @gzg0612 hello,

I use VS Enterprise 2019 16.11.10 and got an error similar with this you expressed. In my case, I have just altered the debug architecture from Arm to x64 by using Configuration Manager in the left side of Start button. Currently everything seems to work exceptedly.

icnocop commented 1 year ago

I'm getting the following build error when trying to build WebView2GettingStarted (Win32): 1>HelloWebView.cpp 1>c:\projects\webview2samples-master\gettingstartedguides\win32_gettingstarted\packages\microsoft.windows.implementationlibrary.1.0.210930.1\include\wil\resource.h(2543): error C2440: 'specialization': cannot convert from 'void (__cdecl *)(HANDLE) noexcept' to 'unknown-type' 1>c:\projects\webview2samples-master\gettingstartedguides\win32_gettingstarted\packages\microsoft.windows.implementationlibrary.1.0.210930.1\include\wil\resource.h(2543): note: Context does not allow for disambiguation of overloaded function

See https://github.com/microsoft/wil/issues/25 and https://github.com/microsoft/wil/issues/272 and https://github.com/microsoft/wil/issues/302

icnocop commented 1 year ago

As a work-around, downgrade the NuGet package Microsoft.Windows.ImplementationLibrary to 1.0.210803.1.