Godot-CPP extension for addons using 64 bit

Godot Version

4.5.1

Question

So.

I can build Godot 4.5.1 with “double” precision:

scons platform=windows tools=yes module_mono_enabled=yes mono_glue=no precision=double arch=x86_64

But Im looking to add my OWN code to “addons”. Subsequently I got “Godot-cpp”. And have tried building it with:

scons platform=windows precision=double target=template_release arch=x86_64

But I get:

Cannot do a precision=double build using ‘gdextension\extension_api.json’ which was generated by Godot built with precision=single

How do I generate “godot-cpp” from the source, with double precision enabled?

Please forgive me if this info is available in the documentation, i DID try to find it :frowning:

How do I generate “godot-cpp” from the source, with double precision enabled?

Build Godot from source using the option precision=double. When you’ve done that, use the built executable to dump the extension api using the argument –dump-extension-api. The command should look something like ‘bin/godot.linuxbsd.editor.x86_64' --dump-extension-api. It will create an extension_api.json in the current directory, which you should use to replace the current one in your godot-cpp\gdextension\extension_api.json. After that, you should be able to run your command to build your extension with double precision.

3 Likes