-
Notifications
You must be signed in to change notification settings - Fork 87
Description
@SteffenL Sorry for bringing this up again, because I know you have answered this question so many times:
- Compilation prompts missing files #40
- compilation error #32 (comment)
- #include "EventToken.h" error #21 (comment)
- compilation error #20 (comment)
- compilation error #20 (comment)
- fatal error: EventToken.h: No such file or directory #17 (comment)
- Error In webview.h #8 (comment)
I have a suggestion that might add better support for mingw64. Here are a few examples I want to present:
- https://learn.microsoft.com/en-us/windows/win32/api/eventtoken/
- https://github.com/microsoft/win32metadata/blob/main/generation/WinSDK/RecompiledIdlHeaders/winrt/EventToken.h
- https://learn.microsoft.com/en-us/windows/win32/api/eventtoken/ns-eventtoken-eventregistrationtoken
- https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/eventtoken.h
- https://github.com/ziglang/zig/blob/9be8a9000faead40b1aec4877506ff10b066659c/lib/libc/include/any-windows-any/eventtoken.h#L4
- https://github.com/search?q=eventtoken.h&type=code&p=2
Here is a screenshot of the file on my local system:
The associated verbose build output:
TERM='dumb' x86_64-w64-mingw32-g++ -I . -m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=$WORK/b500=/tmp/go-build -gno-record-gcc-switches -I $WORK/b500/ -I/nix/store/57s2nhck96xz82vpdq92jkii9c1q2bdq-mingw-w64-x86_64-w64-mingw32-11.0.1-headers/include -I/home/user/go/pkg/mod/github.com/webview/[email protected]/libs/webview/include -DWEBVIEW_STATIC -DWEBVIEW_EDGE -std=c++14 -I/home/user/go/pkg/mod/github.com/webview/[email protected]/libs/mswebview2/include -frandom-seed=Isb35zOTZ8oW2P-K900j -o $WORK/b500/_x004.o -c webview.cc
# github.com/webview/webview_go
In file included from /home/user/go/pkg/mod/github.com/webview/[email protected]/libs/webview/include/webview.h:2076,
from webview.cc:1:
/home/user/go/pkg/mod/github.com/webview/[email protected]/libs/mswebview2/include/WebView2.h:978:10: fatal error: EventToken.h: No such file or directory
978 | #include "EventToken.h"
| ^~~~~~~~~~~~~~
compilation terminated.The important part in the above output is the additional header location added via -I/nix/store/57s2nhck96xz82vpdq92jkii9c1q2bdq-mingw-w64-x86_64-w64-mingw32-11.0.1-headers/include, so that eventtoken.h will be available for include.
It looks like the convention for referencing the "EventToken.h" header with the mingw-64 compilation toolchain, is to use lowercase, e.g. <eventtoken.h>. The Windows API docs itself also refers to this header in lowercase. However, searching GitHub, I can see that both variants are used.
What I'm trying to figure out, is whether this generated file (https://github.com/webview/webview_go/blob/master/libs/mswebview2/include/WebView2.h) could somehow be patched to use a lowercase include of eventtoken.h, and whether that would still work for non-mingw builds.
@SteffenL Do you have insight in how WebView2.h is generated and whether somewhere in the process a lowercase include of eventtoken.h can be used (if not for every toolchain, then specifically for the mingw toolchain)?
