Currently I am trying to get the official GDNative C++ example for Godot 3.5, which can be found here working in the Web Export context. So far, I managed to export to X11.64 without any troubles and managed to set up the creation pipeline for the Web Assembly (see section "Web Assembly Creation Process" below), which now produces a valid output without any error messages. However, as soon as I try to run the game in any browser, it stops loading and displays the following error message:
Aborted(To use dlopen, you need enable dynamic linking,
This link only contains a link to the new documentation of
emscripten, which is used to create the Web Assembly file, and is at the time of writing located at https://emscripten.org/docs/compiling/Dynamic-Linking.html.
Final File Structure
| | └─libsimple.wasm
| | ├─core/
| | └─gen/
Web Assembly Creation and Export Process
At the beginning of the project (only necessary once):
which creates the archive
- Create GDNative Import Files in the Godot Project Directory.
After each change:
- Create the new Web Assembly Library
- Copy the newly created library to the correct location in the Godot Project Folder
cp bin/libsimple.wasm ../godot-project-src/lib/wasm
- Update (if necessary) the GDNative Import Files in the Godot Project Directory.
Just selecting the HTML Export Template via the Godot Editor, choosing the Export Folder and let Godot do its thing.
- Did I miss some necessary settings during the Web Assembly creation? I already had to change some compiler flags for
emccand add include directories compared to the original example to get it even to compile. I also experimented with the optimization flags, the deprecated
-sMAIN_MODULE, but no changes.
- Do I have to create a custom HTML Export Template for this to work properly? According to the GDNative Documentation, if
are created properly, this should not be necessary.
- Is the GDNative C++ Web Export at all possible? During my research, I only found very vague documentation, a lot of (not really related) github issues and more questions than answers.