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

error: "Can't open dynamic library: cef_artifacts/libgdcef.dll" when execute a build for windows platform #45

Open AaronClaros opened 6 months ago

AaronClaros commented 6 months ago

OS: windows 11 Godot version: 4.2.1

Description: gdcef extension works fine on godot editor, but when I try to export for windows, an execute the build, I get this error stack

ERROR: Can't open dynamic library: cef_artifacts/libgdcef.dll. Error: Error 126: The specified module could not be found..
   at: (platform/windows/os_windows.cpp:394)
ERROR: GDExtension dynamic library not found: cef_artifacts/libgdcef.dll
   at: open_library (core/extension/gdextension.cpp:719)
ERROR: Failed loading resource: res://libs/gdcef.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
   at: (core/io/resource_loader.cpp:274)
ERROR: Error loading extension: res://libs/gdcef.gdextension
   at: (core/extension/gdextension_manager.cpp:234)

image

this is how looks in editor, vs windows build image

this is how looks the windows build folder: (I added "cef_artifacts" folder manually) image

Lecrapouille commented 6 months ago

@AaronClaros

Capture d’écran_2024-03-03_10-08-32

Lecrapouille commented 6 months ago

Reopen the ticket if needed

Pastew commented 3 months ago

@Lecrapouille Hello, I have the same problem. Browser runs fine in Godot Editor. But it doesn't work when I export it to Windows.

Build files:

$ ls -lr .
total 68024
-rwxr-xr-x 1 Pastew 197121   593920 Jun 10 00:37  libgdcef.dll*
-rw-r--r-- 1 Pastew 197121    68352 Jun 10 00:37 'CEF in 3D.pck'
-rwxr-xr-x 1 Pastew 197121 68880384 Jun 10 00:37 'CEF in 3D.exe'*
-rwxr-xr-x 1 Pastew 197121   109056 Jun 10 00:37 'CEF in 3D.console.exe'*

If I copy cef_artifacts to build folder it doesn't help.

Output from debug console:

ERROR: Can't open dynamic library: cef_artifacts/libgdcef.dll. Missing dependencies: libcef.dll. Error: Error 126: The specified module could not be found..
   at: (platform/windows/os_windows.cpp:392)
ERROR: GDExtension dynamic library not found: cef_artifacts/libgdcef.dll
   at: open_library (core/extension/gdextension.cpp:719)
ERROR: Failed loading resource: res://cef_artifacts/gdcef.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
   at: (core/io/resource_loader.cpp:274)
ERROR: Error loading extension: res://cef_artifacts/gdcef.gdextension
   at: (core/extension/gdextension_manager.cpp:234)
Godot Engine v4.2.2.stable.official.15073afe3 - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 546.33 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce RTX 3060

ERROR: Viewport Texture must be set to use it.
   at: get_height (scene/main/viewport.cpp:137)
ERROR: Viewport Texture must be set to use it.
   at: get_width (scene/main/viewport.cpp:127)
WARNING: Glow is not supported when using the GL Compatibility backend yet. Support will be added in a future release.
     at: environment_set_glow (servers/rendering/storage/environment_storage.cpp:387)
ERROR: Cannot get class 'GDCef'.
   at: (core/object/class_db.cpp:358)
WARNING: Node CEF of type GDCef cannot be created. A placeholder will be created instead.
     at: instantiate (scene/resources/packed_scene.cpp:254)
SCRIPT ERROR: Invalid call. Nonexistent function 'initialize' in base 'Control'.
          at: _ready (res://GUI.gd:151)

I don't see libs directory you mentioned in this issue inside 3D or 2D demos in this version 0.10.0

Lecrapouille commented 3 months ago

Libs no longer exist with 0.10.0. Remove it. I will ask testing for export since I do not have windows

Lecrapouille commented 3 months ago

@Pastew effectively, Godot does not copy the cef_artfacts folder. From memory, Godot3 did it correctly. Maybe opening a bug on Godot team. You can copy it manually. Other point, there is a small issue on my side. In godot script "exported_artifacts" that can be set with CEF.initialize( is by default equal to the folder path holding with your binary instead of path to cef_artifacts, therefore forcing either to set it each time or to remove the folder cef_artifcats. Ok I'll fix it but also manage absolute pathes. Thnak you!

Lecrapouille commented 2 months ago

Sorry, I had no time for testing my last commit fixing. @Pastew if you want to check. I'll see to create a new tag

Pastew commented 2 months ago

Sure, I will test it when a new tag appears (but not earlier than June 22nd).

For now - I just moved cef_artifacts content to .exe's directory and it works.

c0if commented 1 month ago

Same problem here, and also caught something weird and a weird solution to the problem.

This solution isn't ideal because it's really messy and wastes more disk space, but adding the cef_artifacts content on to the root of exported build directory and adding the cef_artifacts folder with the same content works. Yes you really need to duplicate for it to work.

However, while I was debugging the error using Process Monitor in order to see what paths it was using, I saw that it's able to find the libgdcef.dll file just fine inside my cef/ folder, but for everything such as the libcef.dll, it's unable to find it and goes through most of the Windows filesystem, even though the libcef.dll is also inside the cef/ folder.

image image image

Lecrapouille commented 1 month ago

ok @pimhakkert we have to investigate