Lecrapouille / gdcef

[Plugin][Version 0.10.0][Functional] Chromium Embedded Framework Webview for Godot 3 and 4
https://discord.gg/EckEwy7S5U
MIT License
222 stars 26 forks source link

Build Error for GDCEF #33

Closed XenonSheng closed 1 year ago

XenonSheng commented 1 year ago

Hi, I'm using Godot 3.5.2. I'm now trying to run the demos to test around how it works for this WebView. Currently having build error. May I know what's the problem? I do follow the installation guideline, but not sure why getting this error...

Platform: Windows 10 Python version: 3.11.4 CMake version: 3.27.0 x64 Native Tools Command Prompt for VS 2022 (Run as Admin)

Error said it cannot find the file specified.

C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef>python ./build.py
←[32m[INFO] Checking cmake version ...←[00m
Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32537 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

win.cc
Microsoft (R) Incremental Linker Version 14.36.32537.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:win.exe
win.obj
[INFO] MS C++ Compiler OK
[INFO] Clone cpp wrapper for Godot 3.5 into C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\thirdparty\godot-3.5\cpp
Cloning into 'C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\thirdparty\godot-3.5\cpp'...
remote: Enumerating objects: 7998, done.
remote: Counting objects: 100% (802/802), done.
remote: Compressing objects: 100% (158/158), done.
remote: Total 7998 (delta 695), reused 666 (delta 643), pack-reused 7196
13.62 MiB/s
Receiving objects: 100% (7998/7998), 9.55 MiB | 12.28 MiB/s, done.
Resolving deltas: 100% (5058/5058), done.
Submodule 'godot-headers' (https://github.com/godotengine/godot-headers) registered for path 'godot-headers'
Cloning into 'C:/Users/XXX/Downloads/gdcef-master/gdcef-master/addons/gdcef/thirdparty/godot-3.5/cpp/godot-headers'...
remote: Enumerating objects: 1032, done.
remote: Counting objects: 100% (208/208), done.
remote: Compressing objects: 100% (76/76), done.
remote: Total 1032 (delta 131), reused 167 (delta 114), pack-reused 824
Receiving objects: 100% (1032/1032), 3.14 MiB | 16.59 MiB/s, done.
Resolving deltas: 100% (660/660), done.
Submodule path 'godot-headers': checked out '9e4dd67f928d7ae4e8d8bd77dce2219065a30b9a'
[INFO] Compiling Godot C++ API (inside C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\thirdparty\godot-3.5\cpp) ...
Traceback (most recent call last):
  File "C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\build.py", line 479, in <module>
    compile_godot_cpp()
  File "C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\gdcef\build.py", line 365, in compile_godot_cpp
    run(["scons", "platform=windows", "target=" + GODOT_CPP_TARGET,
  File "C:\Python311\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Python311\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

Appreciate if anyone can assist XD

Lecrapouille commented 1 year ago

@XenonSheng hi ! Has scons been installed correctly (or path to scons correctly set) ? If you redo manualy theses commands (defines here https://github.com/Lecrapouille/gdcef/blob/master/addons/gdcef/build.py#L364-L366), what they return ?

Pathes are defined here https://github.com/Lecrapouille/gdcef/blob/fd14a146fab47fea901a6350d5c0d6b34177b5a9/addons/gdcef/build.py#L55

XenonSheng commented 1 year ago

@Lecrapouille I'm not sure where the scons.exe or scons.bat file is located... I tried to google up where is this file but unfortunately cannot find the answer. The only way to use Scons, is by using this command python -m SCons where SCons is case-sensitive. And try run python -m SCons platform=windows target=<GODOT_CPP_TARGET> where GODOT_CPP_TARGET = release and Build Success with bin\libgodot-cpp.windows.release.64.lib.

but after that, i tried to rerun the build.py again... still getting the same error.

FYI, I also downloaded the latest (4.5.2) SCons zip file from https://scons.org/pages/download.html. There is no scons.bat or scons.exe file inside the folder. From SCons README said, it should be in C:\Users\me\AppData\Roaming\Python\Python310\Scripts. But don't have....

XenonSheng commented 1 year ago

After I changed to run(["python","-m", "SCons", "platform=windows", "target=" + GODOT_CPP_TARGET,"--jobs=" + NPROC], check=True) for my own case, i got another error.

C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapi.h(1105,10): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_message_router.cc) [C:\Users\XXX\Downloads\gdcef-master\gd
cef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9118,11): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_message_router.cc) [C:\Users\XXX\Downloads\gdcef-master\gd
cef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapi.h(1105,10): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_resource_manager.cc) [C:\Users\XXX\Downloads\gdcef-master\
gdcef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapi.h(1105,10): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_scoped_temp_dir.cc) [C:\Users\XXX\Downloads\gdcef-master\g
dcef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9118,11): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_resource_manager.cc) [C:\Users\XXX\Downloads\gdcef-master\
gdcef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapi.h(1105,10): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_stream_resource_handler.cc) [C:\Users\XXX\Downloads\gdcef-
master\gdcef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapi.h(1105,10): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\libcef_dll_wrapper.cc) [C:\Users\XXX\Downloads\gdcef-master\gd
cef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9118,11): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_scoped_temp_dir.cc) [C:\Users\XXX\Downloads\gdcef-master\g
dcef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapi.h(1105,10): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_xml_object.cc) [C:\Users\XXX\Downloads\gdcef-master\gdcef-
master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9118,11): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_stream_resource_handler.cc) [C:\Users\XXX\Downloads\gdcef-
master\gdcef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9118,11): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\libcef_dll_wrapper.cc) [C:\Users\XXX\Downloads\gdcef-master\gd
cef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9118,11): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_xml_object.cc) [C:\Users\XXX\Downloads\gdcef-master\gdcef-
master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapi.h(1105,10): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_zip_archive.cc) [C:\Users\XXX\Downloads\gdcef-master\gdcef
-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9118,11): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\cef_zip_archive.cc) [C:\Users\XXX\Downloads\gdcef-master\gdcef
-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapi.h(1105,10): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\libcef_dll_wrapper2.cc) [C:\Users\XXX\Downloads\gdcef-master\g
dcef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9118,11): error C2061: syntax error: identifie
r 'FILE_INFO_BY_HANDLE_CLASS' (compiling source file C:\Users\XXX\Downloads\gdcef-master\gdcef-master\addons\
gdcef\thirdparty\cef_binary\libcef_dll\wrapper\libcef_dll_wrapper2.cc) [C:\Users\XXX\Downloads\gdcef-master\g
dcef-master\addons\gdcef\thirdparty\cef_binary\libcef_dll_wrapper\libcef_dll_wrapper.vcxproj]
Traceback (most recent call last):
  File "C:\Users\xxx\Downloads\gdcef-master\gdcef-master\addons\gdcef\build.py", line 481, in <module>
    compile_cef()
  File "C:\Users\xxx\Downloads\gdcef-master\gdcef-master\addons\gdcef\build.py", line 278, in compile_cef
    run(["cmake", "--build", ".", "--config", CEF_TARGET], check=True)
  File "C:\Python311\Lib\subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release']' returned non-zero exit status 1.
XenonSheng commented 1 year ago

I'm able to build GDCEF successfully. For previous error, it is required to install Windows SDK (10.0.20348.0) in Visual Studio. image

For SCons path issue, so far still cannot set env path for it since still cannot find the exe/bat file... Alternatively for my case, I update these two lines with python -m SCons

https://github.com/Lecrapouille/gdcef/blob/fd14a146fab47fea901a6350d5c0d6b34177b5a9/addons/gdcef/build.py#L365-L366 https://github.com/Lecrapouille/gdcef/blob/fd14a146fab47fea901a6350d5c0d6b34177b5a9/addons/gdcef/build.py#L382-L386

And @Lecrapouille, Thanks for assist XD

Lecrapouille commented 1 year ago

@XenonSheng thank you for your feedback. I'll update the README indicating the win SDK and in 1st time move "scons" as variable: it will be easier to rename it.

XenonSheng commented 1 year ago

@Lecrapouille Sorry for asking a question which is not related to this issue. May I know is there a way to have a webview for HTML5 export? like how GDCEF works for Windows and Linux. But how about HTML5? I tried to export to HTML5 but got an error said no lib found for this platform as I know it is an expected result.

Lecrapouille commented 1 year ago

@XenonSheng sorry I'm not sure to understand you! Are you looking for a way to download the current page your are watching ? Currently my Godot API does not allow exporting pages but I'm pretty sure the CEF has an API for this. Something like https://magpcss.org/ceforum/viewtopic.php?f=6&t=10500 ? Let open a new ticket I'll see if I can add it.

XenonSheng commented 1 year ago

@Lecrapouille Sorry for any misunderstanding. What I mean here for HTML5 export is this image Usually in web, we use