Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDExtensions not working with beta 10 #70524

Closed
MatSox opened this issue Dec 24, 2022 · 7 comments
Closed

GDExtensions not working with beta 10 #70524

MatSox opened this issue Dec 24, 2022 · 7 comments

Comments

@MatSox
Copy link

MatSox commented Dec 24, 2022

Godot version

4.0 beta 10

System information

Windows 11

Issue description

The classes bonded with GDExtension are not recognized. When you open the editor with some GDExtension plugin it fails to load the classes in the plugin.

Steps to reproduce

Compile the godot-cpp, compile the test (included in godot cpp) voth with scons target=template_debug, open the editor and load the test.

Minimal reproduction project

"N/A"

@Chaosus
Copy link
Member

Chaosus commented Dec 24, 2022

Did you not forget, update it to godotengine/godot-cpp@3da6db4 ?

@MatSox
Copy link
Author

MatSox commented Dec 24, 2022

No, I update it, in fact, everything compiles correctly. If I don't update I have the error due to the renaming of the GDNative in GDExtension.

@Chaosus Chaosus added the bug label Dec 25, 2022
@Chaosus Chaosus added this to the 4.0 milestone Dec 25, 2022
@MatSox
Copy link
Author

MatSox commented Jan 12, 2023

Any news about this? I tried with Godot 11 and it still not working, even the test inside the godot-cpp.
I have the same pattern, everything compiles ok but the engine does not see the gdextension elements, they are not valid.
Am I missing something or it does not work for you too?
Thanks

@akien-mga
Copy link
Member

Possibly a duplicate of #71090.

Is there any error in the console? Can you share your gdextension config file?

@MatSox
Copy link
Author

MatSox commented Jan 13, 2023

these are the errors I have in the console:

SCRIPT ERROR: Parse Error: Identifier "Example" not declared in the current scope.
          at: GDScript::reload (res://main.gd:17)
SCRIPT ERROR: Parse Error: Identifier "Example" not declared in the current scope.
          at: GDScript::reload (res://main.gd:18)
SCRIPT ERROR: Parse Error: "Example" was not found in the current scope.
          at: GDScript::reload (res://main.gd:28)
SCRIPT ERROR: Parse Error: Identifier "ExampleRef" not declared in the current scope.
          at: GDScript::reload (res://main.gd:39)
ERROR: Cannot get class 'Example'.
   at: (core/object/class_db.cpp:326)
ERROR: Cannot get class 'ExampleMin'.
   at: (core/object/class_db.cpp:326)
ERROR: In Object of type 'MissingNode': Attempt to connect nonexistent signal 'custom_signal' to callable 'Node(main.gd.
   at: (core/object/object.cpp:1256)

I'm using the standard gdextension file contained in the godot-cpp repos.

[configuration]

entry_symbol = "example_library_init"

[libraries]

macos.debug = "res://bin/libgdexample.macos.template_debug.framework"
macos.release = "res://bin/libgdexample.macos.template_release.framework"
windows.debug.x86_32 = "res://bin/libgdexample.windows.template_debug.x86_32.dll"
windows.release.x86_32 = "res://bin/libgdexample.windows.template_release.x86_32.dll"
windows.debug.x86_64 = "res://bin/libgdexample.windows.template_debug.x86_64.dll"
windows.release.x86_64 = "res://bin/libgdexample.windows.template_release.x86_64.dll"
linux.debug.x86_64 = "res://bin/libgdexample.linux.template_debug.x86_64.so"
linux.release.x86_64 = "res://bin/libgdexample.linux.template_release.x86_64.so"
linux.debug.arm64 = "res://bin/libgdexample.linux.template_debug.arm64.so"
linux.release.arm64 = "res://bin/libgdexample.linux.template_release.arm64.so"
linux.debug.rv64 = "res://bin/libgdexample.linux.template_debug.rv64.so"
linux.release.rv64 = "res://bin/libgdexample.linux.template_release.rv64.so"
android.debug.x86_64 = "res://bin/libgdexample.android.template_debug.x86_64.so"
android.release.x86_64 = "res://bin/libgdexample.android.template_release.x86_64.so"
android.debug.arm64 = "res://bin/libgdexample.android.template_debug.arm64.so"
android.release.arm64 = "res://bin/libgdexample.android.template_release.arm64.so"

@akien-mga
Copy link
Member

I tested on Linux, compiling current godot-cpp godotengine/godot-cpp@512ec5b with scons target=template_debug.

When I open the demo project with 4.0 beta 11, I do get the "SCRIPT ERROR" in the console the first time (that's a known issue the first time Godot loads a new extension), but then it works fine when running the project, or on subsequent editor runs.

@MatSox
Copy link
Author

MatSox commented Jan 13, 2023

Thank you, I deleted everything and downloaded it from scratch and it seems to work now. It seems that something was compiled wrong even if I manually deleted all the dlls and the .obj files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants