Using any C++ library in Godot ConanCenter now hosts godot-cpp 10, the official C++ bindings for the Godot game engine, enabling developers to bring any C or C++ library into a Godot project through GDExtension. The Conan blog post demonstrates the workflow by integrating the flecs Entity Component System library to simulate 100,000 particles inside a Godot scene, noting that godot-cpp must match the Godot version and each added library must be compiled for every target platform. GDExtension loads a shared library (.dll, .so, .dylib, or .wasm on the web) into an unmodified Godot build at runtime through a stable C interface, and classes exposed this way appear in the editor alongside built-in nodes and are usable from GDScript. < Back to the blog https://blog.conan.io Using any C++ library in Godot Godot https://godotengine.org/ has become one of the most popular game engines of the last few years. It is free, open source under the MIT license, and small enough to download and start using in minutes. Most Godot games are written in GDScript, the engine’s own scripting language. Sooner or later, though, many projects need something that already exists as a C or C++ library: a simulation library, a database, a networking protocol, a machine learning runtime. GDScript cannot call native code, but Godot can load it through GDExtension , and godot-cpp , the official C++ bindings, lets you expose that code as regular engine classes. Writing the C++ code is the easy part. The hard part is the build: godot-cpp has to match your Godot version, and every library you add has to be compiled for each platform you ship to. In this post we give a short tour of Godot, explain how C++ extensions work, and show how to bring C++ libraries into a Godot game with Conan and godot-cpp 10, now available in ConanCenter. As an example we will use flecs https://github.com/SanderMertens/flecs , an Entity Component System library, to simulate 100,000 particles inside a Godot scene. A Quick Introduction to Godot Godot is a general purpose engine for 2D and 3D games. Everything in a Godot project is built from two concepts: - Nodes are the basic building blocks. Each node has a type Sprite2D , Camera3D , AudioStreamPlayer , Timer … , a set of properties you can edit in the Inspector, and callbacks such as ready or process that the engine calls during the game loop. - Scenes are trees of nodes saved to disk as .tscn files. A scene can be a character, a menu or a whole level, and scenes can be instanced inside other scenes. Behavior is usually added by attaching a script to a node. GDScript is a Python-like language designed for the engine, and it is great for gameplay logic because changes show up immediately without a compile step. What makes Godot interesting for C++ developers is that the engine itself is written in C++, and it can load extensions written in C++ without being recompiled. A class that comes from one of these extensions becomes a regular engine class: it shows up in the editor next to the built-in nodes, with its properties in the Inspector, and GDScript can use it like any other node. The next section explains how these extensions work. Extending Godot with C++ There are two ways to add C++ code to Godot: - Engine modules https://docs.godotengine.org/en/stable/engine details/engine api/custom modules in cpp.html are compiled into the engine itself. They have full access to the internals, but you need to build and ship your own copy of Godot, including the editor and export templates for every platform. - GDExtension https://docs.godotengine.org/en/stable/engine details/engine api/gdextension/what is gdextension.html loads a shared library .dll , .so , .dylib , or .wasm on the web into an official, unmodified Godot build at runtime. The engine talks to the library through a stable C interface. GDExtension is the recommended approach for most projects, and it is how many popular plugins are distributed today. Because the C interface is verbose to use directly, the Godot team maintains godot-cpp https://github.com/godotengine/godot-cpp , a C++ library that wraps it with an API very close to the one used inside the engine. It provides a C++ class for every engine class, such as Node2D , Sprite2D or Input . Your own classes are regular C++ code that derives from those classes. A node written with godot-cpp looks like this: include