wxWebView and Windows

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.
User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

wxWebView and Windows

Post by rocrail » Wed Jul 31, 2019 2:07 pm

I'm trying to compile the webview sample for Windows.
MacOS and Linux: No Problem

Windows: Link errors.

Code: Select all



/home/pi/Projects/wxWidgets/win64build/bk-deps x86_64-w64-mingw32-g++ -c -o webview_webview.o -D__WXMSW__      -I../../../samples/webview  -I../../../samples/webview/../../samples -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual  -D_FILE_OFFSET_BITS=64 -I/home/pi/Projects/wxWidgets/win64build/lib/wx/include/x86_64-w64-mingw32-msw-unicode-static-3.1 -I../../../include -O2  ../../../samples/webview/webview.cpp

x86_64-w64-mingw32-windres -i../../../samples/webview/../sample.rc -owebview_sample_rc.o    --define __WXMSW__        --include-dir ../../../samples/webview  --include-dir ../../../samples/webview/../../samples --include-dir /home/pi/Projects/wxWidgets/win64build/lib/wx/include/x86_64-w64-mingw32-msw-unicode-static-3.1 --include-dir ../../../include
x86_64-w64-mingw32-g++ -o webview.exe webview_webview.o webview_sample_rc.o    -L/home/pi/Projects/wxWidgets/win64build/lib -mwindows            -lwxscintilla-3.1-x86_64-w64-mingw32 -lwx_mswu-3.1-x86_64-w64-mingw32 -lwxscintilla-3.1-x86_64-w64-mingw32 -lwxtiff-3.1-x86_64-w64-mingw32 -lwxjpeg-3.1-x86_64-w64-mingw32 -lwxpng-3.1-x86_64-w64-mingw32   -lwxzlib-3.1-x86_64-w64-mingw32 -lwxregexu-3.1-x86_64-w64-mingw32 -lwxexpat-3.1-x86_64-w64-mingw32 -lrpcrt4 -loleaut32 -lole32 -luuid -luxtheme -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32 -loleacc    -lrpcrt4 -loleaut32 -lole32 -luuid -luxtheme -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32 -loleacc
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-uuid.o):uuid.c:(.rdata+0x90): multiple definition of `CLSID_StdURLMoniker'
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-extras-uuid.o):extras-uuid.c:(.rdata$CLSID_StdURLMoniker[CLSID_StdURLMoniker]+0x0): first defined here
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-uuid.o):uuid.c:(.rdata+0xa0): multiple definition of `CLSID_MkProtocol'
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-extras-uuid.o):extras-uuid.c:(.rdata$CLSID_MkProtocol[CLSID_MkProtocol]+0x0): first defined here
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-uuid.o):uuid.c:(.rdata+0xb0): multiple definition of `CLSID_HttpSProtocol'
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-extras-uuid.o):extras-uuid.c:(.rdata$CLSID_HttpSProtocol[CLSID_HttpSProtocol]+0x0): first defined here
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-uuid.o):uuid.c:(.rdata+0xc0): multiple definition of `CLSID_HttpProtocol'
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-extras-uuid.o):extras-uuid.c:(.rdata$CLSID_HttpProtocol[CLSID_HttpProtocol]+0x0): first defined here
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-uuid.o):uuid.c:(.rdata+0xd0): multiple definition of `CLSID_GopherProtocol'
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-extras-uuid.o):extras-uuid.c:(.rdata$CLSID_GopherProtocol[CLSID_GopherProtocol]+0x0): first defined here
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-uuid.o):uuid.c:(.rdata+0xe0): multiple definition of `CLSID_FtpProtocol'
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-extras-uuid.o):extras-uuid.c:(.rdata$CLSID_FtpProtocol[CLSID_FtpProtocol]+0x0): first defined here
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-uuid.o):uuid.c:(.rdata+0xf0): multiple definition of `CLSID_FileProtocol'
/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/../../../../x86_64-w64-mingw32/lib/libuuid.a(lib64_libuuid_a-extras-uuid.o):extras-uuid.c:(.rdata$CLSID_FileProtocol[CLSID_FileProtocol]+0x0): first defined here
collect2: error: ld returned 1 exit status
Makefile:156: recipe for target 'webview.exe' failed
make: *** [webview.exe] Error 1

Someone has a Tip for me?
I added the configure options --enable-webkit and --enable-webview.
Do I miss something?
Best regards,
Rob.

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

Re: wxWebView and Windows

Post by PB » Wed Jul 31, 2019 2:54 pm

Googling the first error (always a good idea) returns e.g. this
https://sourceforge.net/p/mingw-w64/bugs/646/

I.e., your version of mingw is old and buggy and you need to upgrade it.

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: wxWebView and Windows

Post by rocrail » Wed Jul 31, 2019 3:04 pm

Thanks,

but the package is part of Raspbian Stretch:

Code: Select all

sudo apt-get install mingw-w64
There is no update available. :(
Best regards,
Rob.

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

Re: wxWebView and Windows

Post by PB » Wed Jul 31, 2019 3:10 pm

Sorry, I have no idea about developing on that machine, did not even know it <strike>ran</strike> could be used to develop for MSW.

Can you not just patch the file by yourself, assuming you are even using the same MinGW
https://sourceforge.net/p/mingw-w64/min ... f32b13702/

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: wxWebView and Windows

Post by rocrail » Wed Jul 31, 2019 3:15 pm

The uuid.c is not include as source but as library: libuuid.a
I'm not planing to build MINGW from source.
The supplied MINGW version is 6.30...
Best regards,
Rob.

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

Re: wxWebView and Windows

Post by PB » Wed Jul 31, 2019 3:19 pm

Well, if the version you have is unusable and you do not / cannot want to use a newer version, I have no idea how to proceed. Perhaps someone else will...

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: wxWebView and Windows

Post by rocrail » Wed Jul 31, 2019 3:39 pm

The compiler works; Daily builds are made for Windows 32 and 64bit.
But since I try to include the wxWebView into the wxWidgets library, it comes to those errors.
The extra configure options I added are for webview and webkit...
The build process is OK, but the wx sample, webview, does report the link errors.
Best regards,
Rob.

User avatar
doublemax
Moderator
Moderator
Posts: 14098
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxWebView and Windows

Post by doublemax » Wed Jul 31, 2019 4:25 pm

Webkit is not available under Windows. Try without "-enable-webkit", but i don't think that's the issue here.

BTW: Are you cross-compiling for Windows on a Raspberry?
Use the source, Luke!

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: wxWebView and Windows

Post by rocrail » Wed Jul 31, 2019 5:53 pm

Hi,

The Windows builds are always cross compiled, and this works very good for years on a Raspberry Pi.

Because I want to use wxWebView in my application, I looking for a way to get this also working under Windows.

Which configure options should be set, and which should be left out?

My latest cross compile test was under Raspbian Buster, and there were no link errors.
But starting the minimal.exe or webview.exe under Windows 10 pops up an error 0xc000007b and will not run...

https://www.techcrises.com/how-to/how-t ... s-7-8-8-1/
Best regards,
Rob.

User avatar
doublemax
Moderator
Moderator
Posts: 14098
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxWebView and Windows

Post by doublemax » Wed Jul 31, 2019 6:09 pm

Error 0xc000007b is most likely some kind of DLL mismatch. E.g. exe is 32bit, but DLLs are 64bit. Try to research in that direction. Sorry, but i can't be more specific.
Use the source, Luke!

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: wxWebView and Windows

Post by rocrail » Wed Jul 31, 2019 8:10 pm

OK, I solved it by adding -static in the link command.
Now minimal.exe and webview.exe do run on a native Windows 10 64bit computer.

But... It does n ot support *mjpg, video streaming, which works fine under macOS and Linux.
Also the standard browser of Windows 10 does support this format.

I used --enable-webvieie too at configure; Should I leave this out?
Best regards,
Rob.

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: wxWebView and Windows

Post by rocrail » Wed Jul 31, 2019 8:28 pm

Could this call help?

wxWebView::MSWSetEmulationLevel ( wxWebViewIE_EmulationLevel level = wxWEBVIEWIE_EMU_IE11 )

https://docs.wxwidgets.org/trunk/classw ... c8d9b67f8c
Best regards,
Rob.

User avatar
doublemax
Moderator
Moderator
Posts: 14098
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxWebView and Windows

Post by doublemax » Wed Jul 31, 2019 8:56 pm

rocrail wrote:
Wed Jul 31, 2019 8:28 pm
Could this call help?
wxWebView::MSWSetEmulationLevel ( wxWebViewIE_EmulationLevel level = wxWEBVIEWIE_EMU_IE11 )
I don't know, but should be easy enough to try out.
Use the source, Luke!

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: wxWebView and Windows

Post by rocrail » Thu Aug 01, 2019 6:04 am

I did give it a try, but at startup a warning pops up:
Failed to find web view emulation level in the registry
This popup comes for both MSWSetEmulationLevel and MSWSetModernEmulationLevel.
The registry item where wxWidgets is looking for does not exist under Windows 10: Its not in CURRENT_USER but in LOCAL_MACHINE.

Code: Select all

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
Any ideas?
Last edited by rocrail on Thu Aug 01, 2019 6:30 am, edited 3 times in total.
Best regards,
Rob.

User avatar
doublemax
Moderator
Moderator
Posts: 14098
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxWebView and Windows

Post by doublemax » Thu Aug 01, 2019 6:23 am

By default, this registry entry does not exist. I'd say this method is pretty useless if it throws an error in this case :)

Use this code. You need to replace "webview.exe" with the name of your executable. And you must call this before creating the wxWebView.

Code: Select all

#ifdef __WXMSW__
{
  wxLogNull nolog;   // suppress error messages
  wxRegKey rk( wxT("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION") );
  rk.SetValue( wxT("webview.exe"), 11001);
}
#endif
Use the source, Luke!

Post Reply