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

"GDNative C++ example" fails in editor with "undefined symbol: godot_gdnative_init" #25758

Closed
mnn opened this issue Feb 10, 2019 · 2 comments
Closed

Comments

@mnn
Copy link

mnn commented Feb 10, 2019

Godot version: 3.1.beta3.mono.official

OS/device including version:
Linux, Kubuntu 16.04 64b

Issue description:
Example from docs (NativeScript 1.1) is not working. At the end of "Using the GDNative module" section animation is expected to work. Game window opens, but errors are shown in editor and animation is not working:

E 0:00:00:0715   Can't resolve symbol godot_gdnative_init. Error: /xxx/demo/bin/x11/libgdexample.so: undefined symbol: godot_gdnative_init
  <C Source>     drivers/unix/os_unix.cpp:449 @ get_dynamic_library_symbol_handle()
E 0:00:00:0715   Failed to obtain godot_gdnative_init symbol
  <C Source>     modules/gdnative/gdnative.cpp:347 @ initialize()
E 0:00:00:0715   No valid library handle, can't get symbol from GDNative object
  <C Source>     modules/gdnative/gdnative.cpp:487 @ get_symbol()
E 0:00:00:0715   No nativescript_init in "res://bin/x11/libgdexample.so" found
  <C Source>     modules/gdnative/nativescript/nativescript.cpp:1497 @ init_library()

The library file was compiled alright. I don't know if this helps (I don't really know much about how C/C++ and libraries work):

$ readelf -s demo/bin/x11/libgdexample.so -W|grep -Ei init|grep -Ei gdnative
  2104: 000000000003c194   108 FUNC    GLOBAL DEFAULT   12 _ZN5godot5Godot13gdnative_initEP27godot_gdnative_init_options
  1741: 000000000003c194   108 FUNC    GLOBAL DEFAULT   12 _ZN5godot5Godot13gdnative_initEP27godot_gdnative_init_options

Steps to reproduce:
Follow the example in docs. Only things I did differently were using linux instead of not working x11 in platform switch and adding bits=64, even though according to docs it should have been auto-detected on Linux.

@BastiaanOlij
Copy link
Contributor

hard to say from that info but I suspect there may be a mismatch to the godot_cpp library and your library. The missing symbols are functions that are part of the godot_cpp library.

I don't use Linux myself but it may be worth opening up an issue on https://github.com/GodotNativeTools/godot-cpp/issues as well. A few people there do compile the libraries on linux and may be able to point us where we go wrong and what may need to be updated in the docs :)

@akien-mga
Copy link
Member

This should be discussed at https://github.com/GodotNativeTools/godot-cpp to check if it's an issue in the bindings or in the documentation, but a priori it's not an issue with GDNative itself (and thus not this repository).

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

4 participants