Open-source project
godotengine/godot-cpp avatar
godotengine/godot-cpp

godot-cpp: C++ bindings for Godot's GDExtension API

C++ bindings for the Godot script API

2,693 stars811 forksC++MIT

At a glance

What is it?
godot-cpp is the C++ binding layer that lets you write Godot 4 extensions as native shared libraries. It is for engine-level work where GDScript or C# is too slow or too limited, not for typical gameplay scripting.
Who is it for?
Adopt godot-cpp if you need native performance or access to engine internals that GDScript and C# cannot reach, and you are prepared to build a shared library per platform. Do not adopt it as a general scripting replacement: the README's own example registers classes in ClassDB, which is engine-level work, and the build produces separate debug and release binaries per OS and architecture.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 15 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 24, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What godot-cpp actually solves

Godot's own scripting languages cover most game logic. The gap godot-cpp fills is the one where a script cannot reach: code that must run at native speed, or that needs to touch engine internals exposed through the GDExtension API. The README describes the repository as containing "the C++ bindings for the Godot Engine's GDExtensions API", which is a narrower claim than "C++ support for Godot" and worth reading carefully. You are not writing a Godot game in C++. You are writing a shared library that Godot loads at runtime, registers classes from, and then calls into from scripts or the editor. Any node and resource you register appears in the corresponding Create dialog, and any class becomes available to scripting. That is the contract: C++ supplies the implementation, Godot supplies the object model and the editor integration. The audience is therefore narrow. Extension authors who are already comfortable with a C++ toolchain, and who have a specific reason to leave GDScript behind, get something useful here. Teams hoping for a faster general-purpose scripting language will find the setup cost disproportionate to the gain.

How the binding layer and versioning fit together

The repository is not a runtime library in the usual sense. It contains a binding generator, a SCons build description, and generated C++ headers and sources under include/ and src/, with gdextension/ holding the API description the generator consumes. Building produces a shared library that Godot loads through a .gdextension file. The entry point is a C function whose name you choose and then declare in that file as entry_symbol. Inside it, godot::GDExtensionBinding::InitObject registers your initializer and terminator and sets the minimum library initialization level. Your initializer then calls GDREGISTER_CLASS for each class you want exposed. Versioning changed with the 10.x line: godot-cpp is now versioned independently from Godot, and v10 can target Godot 4.3 or later through the api_version parameter. Compatibility is one-directional. A GDExtension built for Godot 4.3 runs in 4.4, but one built for 4.4 will not run in 4.3. The README recommends that extension authors pass a default target version into godot-cpp's SConstruct so the extension is always built against a version that provides the features it needs. This is a sensible default and the project says so directly. It is also the point where most build failures originate, because the version baked into the build must not exceed the version of the editor loading the result.

Installing godot-cpp and building a first extension

There is no package manager step. The README points at the official build instructions for the godot repository and says you need the same C++ prerequisites installed for your target platform. Once those are in place, the build is driven by SCons. The api_version parameter selects the Godot version you target:

bash
scons api_version=4.3

If you would rather build against an exact API dump, generate one from your Godot binary and pass it instead. This is the path to take when you need to match a specific editor build precisely:

bash
godot --dump-extension-api
scons custom_api_file=extension_api.json

The Makefile in the repository wraps the same SCons invocation for convenience. It defaults to TARGET = template_debug and API_VERSION = 4.7, and exposes linux, windows and macos targets that map to platform and arch flags:

bash
make linux64

After the build you need a .gdextension file in your Godot project. The README gives a minimal example with an entry_symbol, a compatibility_minimum, and per-platform library paths for debug and release. Note that the paths differ per OS and per architecture, and the comment in the example tells you to repeat the entries for arm64, rv64 and anything else you ship. The entry_symbol must match the exported C function in your library. The README's example uses example_library_init and registers an initialize_example_module function that calls GDREGISTER_CLASS(Example) at MODULE_INITIALIZATION_LEVEL_SCENE. If your symbol name and the one in the file disagree, Godot will not load the library and the error will not point at the mismatch directly.

Where godot-cpp is the wrong tool

The build output is a shared library per platform, per architecture, and per build type. The README's .gdextension example lists six library paths for three operating systems in debug and release, before any arm64 or rv64 entries are added. Every one of those is an artifact you have to produce, ship and keep in sync with the editor version your users run. For a solo developer targeting one desktop platform, that is manageable. For a project shipping to mobile, web or consoles, the matrix grows quickly and the README does not describe a packaging or distribution story beyond the file format itself. There is a second, quieter cost. Nothing in the README describes hot reloading of a rebuilt native library during an editor session, and the README does not document rollback if a new binary breaks a project. That means the iteration loop for C++ extension work is heavier than editing a script and pressing play. If your problem is gameplay logic, UI behaviour or anything that GDScript handles at acceptable speed, godot-cpp adds a compiler, a platform matrix and a version-matching problem in exchange for performance you may not need.

godot-cpp compared with C# and GDScript

The real alternative for most teams is not another C++ binding, it is staying inside Godot's own languages. C# in Godot is a managed runtime: you write classes, the engine hosts them, and the toolchain handles the platform packaging through the editor's export pipeline. godot-cpp is the opposite arrangement. You own the toolchain, you own the artifacts, and Godot loads them as a foreign library through a .gdextension descriptor. That difference shows up in every step: C# code is compiled by the editor's build integration, while godot-cpp code is compiled by SCons or CMake and then hand-wired into a file that names each binary path. The payoff is direct access to the GDExtension API and native execution without a managed runtime in the loop. The cost is that the version compatibility rules are now your responsibility. The README states the rule plainly: extensions targeting an earlier Godot version work in later minor versions, not the reverse. With C# or GDScript, the engine and the script version move together. With godot-cpp, they can drift, and the drift is silent until load time.

Maintenance, licence and upgrade cost

The last push to the repository was on 2026-09-15, and the 10.0.0-stable release carries the same date. The 10.0.0 line is recent enough that most published examples and third-party templates predate the split from Godot's own version numbers, so expect to translate older instructions into the api_version model. Upgrading godot-cpp is not a drop-in operation. Because the binding is generated from the engine's API description, a new godot-cpp version can change generated signatures, and your extension code compiles against those. The README's own advice to pin a default api_version in the SConstruct call is the mitigation: it fixes the target so an upgrade of godot-cpp does not silently raise the minimum Godot version your extension requires. The licence is MIT, which is permissive and compatible with shipping in closed-source projects. That is the whole of what the repository states on the subject; it is not legal advice and the obligations you carry depend on how you distribute the resulting binaries.

Editorial conclusion

Adopt godot-cpp if you need native performance or access to engine internals that GDScript and C# cannot reach, and you are prepared to build a shared library per platform. Do not adopt it as a general scripting replacement: the README's own example registers classes in ClassDB, which is engine-level work, and the build produces separate debug and release binaries per OS and architecture. Before committing, verify that your target Godot version matches the api_version you pass to scons, and confirm that every platform you ship on has a matching entry in your .gdextension file.

Frequently asked questions

How do I install godot-cpp?

There is no package to install. The README says you need the same C++ prerequisites as the godot repository, following the official build instructions for your platform, and then you build with SCons, for example scons api_version=4.3.

What is godot-cpp?

It is the C++ bindings for the Godot Engine's GDExtensions API. Building it produces a shared library that Godot loads through a .gdextension file, and classes you register become available in the editor and to scripting.

How do I use godot-cpp in a project?

Build the extension, then add a .gdextension file with an entry_symbol and per-platform library paths for debug and release. Your exported C function registers an initializer that calls GDREGISTER_CLASS for each class you want exposed.

Does Godot support C++?

Yes, through GDExtensions. godot-cpp provides the C++ bindings for that API, and version 10 can target Godot 4.3 or later using the api_version parameter.

Which is better for Godot, C# or C++?

The README does not rank them. It does show the difference in arrangement: C# is hosted by the engine, while godot-cpp builds a native shared library that you compile per platform and load through a .gdextension file, with the version compatibility rules resting on you.

Official sources

  1. godotengine/godot-cpp on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/godotengine-godot-cpp.svg)](https://hysenlabs.com/projects/godotengine-godot-cpp)