Lecrapouille / gdcef

[Plugin][Version 0.10.0][Functional] Chromium Embedded Framework Webview for Godot 3 and 4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nonexistent function 'initialize' when running demos

jasbur opened this issue · comments

I've successfully run the build.py and copied the build folder into the project directory. However, when I open the project in Godot 3.5 and click Play (F5) I get the error:

Invalid call. Nonexistent function 'initialize' in base 'Node'.

In the "2D" demo project, line 177 in CEF.gd is referred to. I've also tried running the "HelloCEF" project and received the same error. Am I missing something?

@jasbur Sorry for the long delay, GitHub did not ping me about your ticket ;(

and copied the build folder into the project directory. you have nothing to do manually. With Linux you have a symbolic link. With Windows, you need admin rights to create the link.

Do you mean this initialize

if !$CEF.initialize({"artifacts":resource_path, "incognito":true, "locale":"en-US"}):

I guess your .so libs are not found by Godot. Do you use Linux ? Check if https://github.com/Lecrapouille/gdcef/blob/master/addons/gdcef/demos/HelloCEF/libs/gdcef.gdns and https://github.com/Lecrapouille/gdcef/blob/master/addons/gdcef/demos/HelloCEF/libs/gdcef.gdnlib are well loaded by Godot and paths to lib inside them are correct.

Concerning error, you have console logs and Godot logs that can help us to investigate.

@jasbur I reviewing my script I think a symbolic link to cef artifacts was not created correctly. I'll fix it. Thank you!. I close this ticket, feel free to open it if needed.

Why is this implemented with GDNative instead of GDExtension?

Apologies, what I mean to ask is: what is the underlying problem? I would like to avoid debugging a gdns file if at all possible. I don't think it makes sense to have to manually maintain it.

Why is this implemented with GDNative instead of GDExtension?

@stockle beware of the git branch: there are 2 branches: godot-3 with gdnative and godot-4 with gdextensions. Godot-4 and Godot-3 are not compatible. Choose the branch depending on which Godot version you want. (Note: I stopped maintaining for Godot-3). I initially wanted to manage both versions in a single master branch, but I'm too lazy :)

underlying problem?

There is no problem :) A symbolic link was not made correctly, Godot-4 could not find gdextensions files. There are made for the demos. Up to you to place cef artifacts and gdns files where you want.

Thank you @Lecrapouille. After playing around this this aligns with my experience. I downloaded the 4.x branch but I am still getting linking errors after generating the shared libraries.

In HelloCEF as well as another project that imports the build output files (/my/path/build/*.so) & defines the gdcef.gdextension pathing correctly, I am getting this error. This is after exporting the vars in my .bashrc and sourcing.

Can't open dynamic library: /home/<user>/gdcef-4c27efd2e7e12d20d6e817b56f2752f743f3de42/addons/gdcef/demos/HelloCEF/cef_artifacts/libgdcef.so. Error: /home/<user>/Desktop/../lib/libgdcef.so: cannot open shared object file: No such file or directory.
  core/extension/gdextension.cpp:719 - GDExtension dynamic library not found: /home/<user>/gdcef-4c27efd2e7e12d20d6e817b56f2752f743f3de42/addons/gdcef/demos/HelloCEF/cef_artifacts/libgdcef.so
  Failed loading resource: res://libs/gdcef.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
  Cannot get class 'GDCef'.

Would you like me to open another issue or do you have an idea of how I can debug this?

I also tried updating the build.py to pull from the 4.2.1-stable branch of godot-cpp as that is the version of my Godot editor, however this produced the same results.

Thanks again. I look forward to using this extension 😄

@stockle this is not a Godot error but .so not found.

If I summary your steps well:

  • you are on Linux
  • you've git cloned the godot-4.x branch of this repo
  • launch build.py without modifying it (you've not changed CEF_BUILD_FOLDER_NAME and CEF_ARTIFACTS_FOLDER_NAME)
  • once the build done with success, you've saved in your .bashrc file the command (with the path adapted to your case):
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/qq/MyGitHub/gdcef/build
   export LD_PRELOAD=/home/qq/MyGitHub/gdcef/build/libcef.so
  • You've not modified gdcef/addons/gdcef/demos/HelloCEF/libs/gdcef.gdextension
  • You started godot-4 and run the demo: this is working.
  • You have created your own project, copying the gdcef/build/ (the gdcef/addons/gdcef/demos/HelloCEF/cef_artifacts/ is an alias to gdcef/build/) in your Godot res:// folder. Add your own gdcef.gdextension referring to .so file in your new res://build folder.

Have you changed LD_LIBRARY_PATH and LD_PRELOAD ? I do not know to make an usable project without setting them in env.