Lecrapouille / gdcef

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

Nonexistent function 'initialize' when running demos #35

Closed jasbur closed 9 months ago

jasbur commented 10 months ago

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?

Lecrapouille commented 9 months ago

@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

https://github.com/Lecrapouille/gdcef/blob/f7735133120f576eecc5169d73be9b2c4aacd948/addons/gdcef/demos/HelloCEF/CEF.gd#L141

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.

Lecrapouille commented 9 months ago

@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.

stockle commented 6 months ago

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.

Lecrapouille commented 6 months ago

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.

stockle commented 6 months ago

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 :smile:

Lecrapouille commented 6 months ago

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

If I summary your steps well:

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