khchen / wNim

Nim's Windows GUI Framework
MIT License
327 stars 17 forks source link

webview compile error #123

Open MelonCodeUK opened 5 months ago

MelonCodeUK commented 5 months ago

Hi, I found your bible library, it is very suitable for me to create a web application. But, I couldn't even compile your example:

D:\projects\MelonPlayer\tests\wNim\examples>nim cpp -r webView.nim
Hint: used config file 'D:\nim-2.0.2\config\nim.cfg' [Conf]
Hint: used config file 'D:\nim-2.0.2\config\config.nims' [Conf]
..............................................................................................................................................................................................................................................................................................................................
CC: C:/Users/user/.nimble/pkgs2/wnim-0.13.3-9c2a231078dd449bb3fe923ed52bb032c26db96c/wNim/private/controls/wWebView.nim
C:\Users\user\nimcache\webView_d\@mC@c@sUsers@suser@s.nimble@spkgs2@swnim-0.13.3-9c2a231078dd449bb3fe923ed52bb032c26db96c@swNim@sprivate@scontrols@swWebView.nim.cpp: In function 'NI32 AddRef__6758Z85sersZuserZOnimbleZpkgs50Zwnim4548O4951O514557c50a505149485556dd525257bb51fe575051ed5350bb485150c5054db5754cZw78imZprivateZcontrolsZw87eb86iew_u71(tyObject_wWeb__qBYmmU7iqjJqrgjrUDNbKw*)':
C:\Users\user\nimcache\webView_d\@mC@c@sUsers@suser@s.nimble@spkgs2@swnim-0.13.3-9c2a231078dd449bb3fe923ed52bb032c26db96c@swNim@sprivate@scontrols@swWebView.nim.cpp:1647:40: error: no matching function for call to '_InterlockedIncrement(NI32*&)'
 1647 |         NI32 T2_ = InterlockedIncrement(T1_);
      |                                        ^
In file included from D:/msys64/mingw64/include/winnt.h:27,
                 from D:/msys64/mingw64/include/minwindef.h:163,
                 from D:/msys64/mingw64/include/windef.h:9,
                 from D:/msys64/mingw64/include/windows.h:69,
                 from C:\Users\user\nimcache\webView_d\@mC@c@sUsers@suser@s.nimble@spkgs2@swnim-0.13.3-9c2a231078dd449bb3fe923ed52bb032c26db96c@swNim@sprivate@scontrols@swWebView.nim.cpp:10:
D:/msys64/mingw64/include/psdk_inc/intrin-impl.h:1670:10: note: candidate: 'long int _InterlockedIncrement(volatile long int*)' (near match)
 1670 | __LONG32 _InterlockedIncrement(__LONG32 volatile *Addend) {
      |          ^~~~~~~~~~~~~~~~~~~~~
D:/msys64/mingw64/include/psdk_inc/intrin-impl.h:1670:10: note:   conversion of argument 1 would be ill-formed:
In file included from D:/msys64/mingw64/include/windows.h:70:
D:/msys64/mingw64/include/winbase.h:3487:24: note: candidate: 'unsigned int _InterlockedIncrement(volatile unsigned int*)' (near match)
 3487 |   FORCEINLINE unsigned InterlockedIncrement (unsigned volatile *Addend) {
      |                        ^~~~~~~~~~~~~~~~~~~~
D:/msys64/mingw64/include/winbase.h:3487:24: note:   conversion of argument 1 would be ill-formed:
D:/msys64/mingw64/include/winbase.h:3491:29: note: candidate: 'long unsigned int _InterlockedIncrement(volatile long unsigned int*)' (near match)
 3491 |   FORCEINLINE unsigned long InterlockedIncrement (unsigned long volatile *Addend) {
      |                             ^~~~~~~~~~~~~~~~~~~~
D:/msys64/mingw64/include/winbase.h:3491:29: note:   conversion of argument 1 would be ill-formed:
D:/msys64/mingw64/include/winbase.h:3500:32: note: candidate: 'long long unsigned int _InterlockedIncrement(volatile long long unsigned int*)'
 3500 |   FORCEINLINE unsigned __int64 InterlockedIncrement (unsigned __int64 volatile *Addend) {
      |                                ^~~~~~~~~~~~~~~~~~~~
D:/msys64/mingw64/include/winbase.h:3500:81: note:   no known conversion for argument 1 from 'NI32*' {aka 'int*'} to 'volatile long long unsigned int*'
 3500 |   FORCEINLINE unsigned __int64 InterlockedIncrement (unsigned __int64 volatile *Addend) {
      |                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
C:\Users\user\nimcache\webView_d\@mC@c@sUsers@suser@s.nimble@spkgs2@swnim-0.13.3-9c2a231078dd449bb3fe923ed52bb032c26db96c@swNim@sprivate@scontrols@swWebView.nim.cpp: In function 'NI32 Release__6758Z85sersZuserZOnimbleZpkgs50Zwnim4548O4951O514557c50a505149485556dd525257bb51fe575051ed5350bb485150c5054db5754cZw78imZprivateZcontrolsZw87eb86iew_u77(tyObject_wWeb__qBYmmU7iqjJqrgjrUDNbKw*)':
C:\Users\user\nimcache\webView_d\@mC@c@sUsers@suser@s.nimble@spkgs2@swnim-0.13.3-9c2a231078dd449bb3fe923ed52bb032c26db96c@swNim@sprivate@scontrols@swWebView.nim.cpp:1812:40: error: no matching function for call to '_InterlockedDecrement(NI32*&)'
 1812 |         NI32 T2_ = InterlockedDecrement(T1_);
      |                                        ^
D:/msys64/mingw64/include/psdk_inc/intrin-impl.h:1681:10: note: candidate: 'long int _InterlockedDecrement(volatile long int*)' (near match)
 1681 | __LONG32 _InterlockedDecrement(__LONG32 volatile *Addend) {
      |          ^~~~~~~~~~~~~~~~~~~~~
D:/msys64/mingw64/include/psdk_inc/intrin-impl.h:1681:10: note:   conversion of argument 1 would be ill-formed:
D:/msys64/mingw64/include/winbase.h:3505:24: note: candidate: 'unsigned int _InterlockedDecrement(volatile unsigned int*)' (near match)
 3505 |   FORCEINLINE unsigned InterlockedDecrement (unsigned volatile *Addend) {
      |                        ^~~~~~~~~~~~~~~~~~~~
D:/msys64/mingw64/include/winbase.h:3505:24: note:   conversion of argument 1 would be ill-formed:
D:/msys64/mingw64/include/winbase.h:3509:29: note: candidate: 'long unsigned int _InterlockedDecrement(volatile long unsigned int*)' (near match)
 3509 |   FORCEINLINE unsigned long InterlockedDecrement (unsigned long volatile *Addend) {
      |                             ^~~~~~~~~~~~~~~~~~~~
D:/msys64/mingw64/include/winbase.h:3509:29: note:   conversion of argument 1 would be ill-formed:
D:/msys64/mingw64/include/winbase.h:3518:32: note: candidate: 'long long unsigned int _InterlockedDecrement(volatile long long unsigned int*)'
 3518 |   FORCEINLINE unsigned __int64 InterlockedDecrement (unsigned __int64 volatile *Addend) {
      |                                ^~~~~~~~~~~~~~~~~~~~
D:/msys64/mingw64/include/winbase.h:3518:81: note:   no known conversion for argument 1 from 'NI32*' {aka 'int*'} to 'volatile long long unsigned int*'
 3518 |   FORCEINLINE unsigned __int64 InterlockedDecrement (unsigned __int64 volatile *Addend) {
      |                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
Error: execution of an external compiler program 'g++.exe -c -std=gnu++17 -funsigned-char  -w -fmax-errors=3 -fpermissive -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN   -ID:\nim-2.0.2\lib -ID:\projects\MelonPlayer\tests\wNim\examples -o C:\Users\user\nimcache\webView_d\@mC@c@sUsers@suser@s.nimble@spkgs2@swnim-0.13.3-9c2a231078dd449bb3fe923ed52bb032c26db96c@swNim@sprivate@scontrols@swWebView.nim.cpp.o C:\Users\user\nimcache\webView_d\@mC@c@sUsers@suser@s.nimble@spkgs2@swnim-0.13.3-9c2a231078dd449bb3fe923ed52bb032c26db96c@swNim@sprivate@scontrols@swWebView.nim.cpp' failed with exit code: 1

can you help me solve the problem?

khchen commented 4 months ago

Try to use nim c webView.nim.