Skip to main content

What you need installed

What has to be on your computer to build your game. Players need none of this; see Platforms for their side.

BuildWhat you need
Desktop: Source, Bytecode, Embedded AOT, Shared AOTNothing beyond cTurtle (Studio, or ctgame from a cTurtle build)
Desktop: Linked AOTcTurtle, plus the C toolchain
Desktop: any game with its own C codecTurtle, plus the C toolchain
Desktop: debuggable build (bt_debug_runtime)Nothing beyond cTurtle (the C toolchain only if the game also has its own C code)
WebcTurtle with its web SDK

ctgame finds the BT compiler and its other helper files next to itself. Keep the folder it came in together; don't copy ctgame out on its own.

C toolchain​

Needed only for the builds marked above. Install:

  1. CMake 3.22 or newer.
  2. The same C compiler, at the same version, that built your copy of cTurtle. cTurtle's libraries are linked into your game, so a different compiler is rejected. cTurtle is tested with MinGW-w64 GCC on Windows and GCC on Linux.
  3. The build tool CMake uses with that cTurtle build (for example Ninja or make).

You also choose a build configuration (Release, Debug, ...). It must match the configuration your copy of cTurtle was built in, which is usually Release.

In Studio​

Open Build Settings → Native Toolchain and set:

FieldWhat to enter
Compiler presetHost compiler picks the compiler cTurtle was built with. This is almost always the right choice.
C compilerFilled in by the preset; or the path to the compiler.
CMakePath to cmake.
ConfigurationThe configuration Studio was built in, usually Release.

Click Save Toolchain. These settings are saved for this project on this computer only (in .studio-native-build, which you shouldn't commit) and are used by every build that needs them. See Building from Studio.

On the command line​

ctgame uses the tools that built cTurtle by default. To use others, pass them as options or set environment variables:

ctgame build --target "Linux Release" \
--native-cmake /usr/bin/cmake \
--native-compiler /usr/bin/gcc \
--native-config Release \
MyGame.ctproject

The full list of options and variables is in ctgame.

Toolchain errors​

MessageWhat to do
Native SDK requires <compiler> <version>, 8-byte pointers and <configuration>. ...Your compiler, its version or the configuration differs from the one cTurtle was built with. Pick Host compiler and the configuration named in the message.
A CMake error about a missing generator or make programInstall the build tool your cTurtle was built with, or pass --native-generator and --native-make-program.
C compile or link errorsProblems in your own C code are shown in Studio's Output and Problems panels with clickable locations.

If you switch compilers, delete the project's .ctbuild folder so the next build starts clean.

Web SDK​

Web builds use the cTurtle web SDK, a folder named web-sdk that contains its own compiler. You don't need to install Emscripten, Node, Python or CMake for a web build.

ctgame looks for the SDK in this order:

  1. The folder in the CTGAME_WEB_SDK environment variable.
  2. A web-sdk folder next to ctgame (Studio packages that include web support have one).
  3. The web SDK of the cTurtle build that produced ctgame.

If none is usable, the build fails with web SDK is missing or incomplete. Get a cTurtle package that includes web-sdk, or point CTGAME_WEB_SDK at one. The web SDK must come from the same cTurtle version as ctgame.