The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

+5 votes

Upon opening a project that contains a GDNative script with the linux headless version of Godot(3.2.1), the following error is generated:

ERROR: init_library: does not have a library for the current platform.
At: modules/gdnative/nativescript/nativescript.cpp:1483.

using the linux server export template:
ERROR: initlibrary: Condition "libpath.length() == 0" is true.
At: modules/gdnative/nativescript/nativescript.cpp:1483.

This line in nativescript.cpp regards getcurrentlibrary_path(), which returns empty.

I generated bindings from the headless version using --gdnative-generate-json-api api.json (which seems to be identical the full version anyway) and recompiled the script to no avail.

I need to run on a headless server. Is this a fundamental issue with headless where I have to write modules instead or is there a trick? Thanks in advance.

in Engine by (34 points)

1 Answer

+5 votes
Best answer

I just had this problem. You have to manually add entry/dependencies to the *.gdnlib file. If you are compiling for linux, for instance, copy the lines with the paths to your library and dependencies but use Server instead of X11.64:

[entry]

X11.64="res://path/to/my/lib.so"

Server="res://path/to/my/lib.so"

by (54 points)
selected by

This really helped me back when you posted. Thanks for taking the time to answer.

All the Best

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.