Edge (Chromium) backend build errror (3.1.4) Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
alopes
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu Jul 23, 2020 8:33 am

Edge (Chromium) backend build errror (3.1.4)

Post by alopes » Thu Jul 23, 2020 12:02 pm

Hi,
I'm trying to build the new 3.1.4 version of the wxWidgets lib and following the build steps on https://docs.wxwidgets.org/trunk/classwx_web_view.html i go the build error.
In file included from ../../src/msw/webview_edge.cpp:30:0:
..\..\include/wx/msw/private/webview_edge.h:16:10:fatal error: Webview2.h: No such file or directory
#include <Webview2.h>.
I even tried to copy the file from wxWidgets/3rdparty/webview2 to the include/wx/msw/private but still get the error. Two things came to mind that the file that came with the WebView2 SDK the name is WebViews2.h and not Webviews2.h. The other think is on the build steps it says that visual studio 2015 or newer is required and I have installed the Visual Studio 2019 Preview, so I'm not 100% sure if that one is enough.

Best regards,

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2469
Joined: Sun Jan 03, 2010 5:45 pm

Re: Edge (Chromium) backend build errror (3.1.4)

Post by PB » Thu Jul 23, 2020 12:23 pm

I have built wxWidgets with that backend using CMake and MSVC 2019 Community with no problems, back when it was first introduced into the master.

I have just tried with MSVC 2017 and 3.1.4 with CMake (I would rather not modify my main setup.h) in 32-bit Debug DLL configuration, following the setup instructions you linked.

Builds and runs the sample just fine
wxedge.png
wxedge.png (58.18 KiB) Viewed 106 times
Please describe what exactly did you do and how you built wxWidgets (bundled makefile or MSVS solution, CMake...), perhaps you missed a step or made a typo just like in the OP (Webviews2.h)?

My guess would be extracting the nuget package into a wrong folder. WebView2.h and WebView2EnvironmentOptions.h must be in WXWIN\3rdparty\webview2\build\native\include

But I have always used only CMake, so it is possible that the other build options may be broken... I will try using MSVC solution ASAP.

alopes
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu Jul 23, 2020 8:33 am

Re: Edge (Chromium) backend build errror (3.1.4)

Post by alopes » Thu Jul 23, 2020 12:32 pm

I followed the steps on the build, download the SDK, copy it to 3rdparty, enable it in setup.h and the only thing that it may be different from you is that I build the library with the following command
C:\library\wxWidgets-3.1.4\build\msw>mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 and not MSVC. I actually only used that command to build the library and never used the MSVC IDE.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2469
Joined: Sun Jan 03, 2010 5:45 pm

Re: Edge (Chromium) backend build errror (3.1.4)

Post by PB » Thu Jul 23, 2020 12:35 pm

Edge backend unfortunately cannot be used with MinGW (same for the the other still unmerged Chromium backend, wxWebViewChromium), the docs clearly states
Visual Studio 2015, or newer, is required

alopes
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu Jul 23, 2020 8:33 am

Re: Edge (Chromium) backend build errror (3.1.4)

Post by alopes » Thu Jul 23, 2020 12:37 pm

Btw can you share the cmake build steps as I'm not experienced with it.
Thanks

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2469
Joined: Sun Jan 03, 2010 5:45 pm

Re: Edge (Chromium) backend build errror (3.1.4)

Post by PB » Thu Jul 23, 2020 12:43 pm

CMake cannot help you, if you use MinGW (you said you had MSVC 2019 Preview in the OP) you are out of luck.

MSVC required means not just installed, but used to build wxWidgets and the application.

alopes
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu Jul 23, 2020 8:33 am

Re: Edge (Chromium) backend build errror (3.1.4)

Post by alopes » Thu Jul 23, 2020 4:20 pm

Solved it by switching to visual studio.
Thanks for the support.

Post Reply