How to open GDNative projects with headless/server Godot?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tim_e

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: init_library: Condition “lib_path.length() == 0” is true.
At: modules/gdnative/nativescript/nativescript.cpp:1483.

This line in nativescript.cpp regards get_current_library_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.

:bust_in_silhouette: Reply From: Wilson Kazuo Mizutan

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"

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

All the Best

tim_e | 2020-03-26 17:16