Work in progress
Godot documentation is being updated to reflect the latest changes in version
4.0. Some documentation pages may
still state outdated information. This banner will tell you if you're reading one of such pages.
The contents of this page are up to date. If you can still find outdated information, please open an issue.
Compiling for Windows¶
This page describes how to compile Windows editor and export template binaries from source. If you're looking to export your project to Windows instead, read Exporting for Windows.
For compiling under Windows, the following is required:
Visual Studio Community, version 2017 or later. VS 2019 is recommended. Make sure to read "Installing Visual Studio caveats" below or you will have to run/download the installer again.
MinGW-w64 with GCC can be used as an alternative to Visual Studio. Be sure to install/configure it to use the
posixthread model. Important: When using MinGW to compile the
masterbranch, you need GCC 9 or later.
Python 3.6+. Make sure to enable the option to add Python to the ``PATH`` in the installer.
SCons 3.0+ build system. Using the latest release is recommended, especially for proper support of recent Visual Studio releases.
If you have Scoop installed, you can easily install MinGW and other dependencies using the following command:
scoop install gcc python scons make
If you have MSYS2 installed, you can easily install MinGW and other dependencies using the following command:
pacman -S mingw-w64-x86_64-python3-pip mingw-w64-x86_64-gcc \ mingw-w64-i686-python3-pip mingw-w64-i686-gcc make
For each MSYS2 MinGW subsystem, you should then run pip3 install scons in its shell.
To get the Godot source code for compiling, see Getting the source.
For a general overview of SCons usage for Godot, see Introduction to the buildsystem.
Setting up SCons¶
To install SCons, open the command prompt and run the following command:
python -m pip install scons
If you are prompted with the message
Defaulting to user installation because normal site-packages is not
writeable, you may have to run that command again using elevated
permissions. Open a new command prompt as an Administrator then run the command
again to ensure that SCons is available from the
To check whether you have installed Python and SCons correctly, you can
python --version and
scons --version into a command prompt
If the commands above don't work, make sure to add Python to your
environment variable after installing it, then check again.
You can do so by running the Python installer again and enabling the option
to add Python to the
If SCons cannot detect your Visual Studio installation, it might be that your
SCons version is too old. Update it to the latest version with
python -m pip install --upgrade scons.
Installing Visual Studio caveats¶
If installing Visual Studio 2017 or 2019, make sure to enable C++ in the list of workflows to install.
If installing Visual Studio 2015, make sure to run a Custom installation instead of Typical and select C++ as a language there.
If you've already made the mistake of installing Visual Studio without C++ support, run the installer again; it should present you a Modify button. Running the installer from Add/Remove Programs will only give you a Repair option, which won't let you install C++ tools.
Downloading Godot's source¶
Refer to Getting the source for detailed instructions.
The tutorial will assume from now on that you placed the source code in
To prevent slowdowns caused by continuous virus scanning during compilation, add the Godot source folder to the list of exceptions in your antivirus software.
For Windows Defender, hit the Windows key, type "Windows Defender Settings" then hit Enter. Under Virus & threat protection, go to Virus & threat protection setting and scroll down to Exclusions. Click Add or remove exclusions then add the Godot source folder.
Selecting a compiler¶
SCons will automatically find and use an existing Visual Studio installation.
If you do not have Visual Studio installed, it will attempt to use
MinGW instead. If you already have Visual Studio installed and want to
use MinGW, pass
use_mingw=yes to the SCons command line. Note that MSVC
builds cannot be performed from the MSYS2 or MinGW shells. Use either
cmd.exe or PowerShell instead.
During development, using the Visual Studio compiler is usually a better idea, as it links the Godot binary much faster than MinGW. However, MinGW can produce more optimized binaries using link-time optimization (see below), making it a better choice for production use.
After opening a command prompt, change to the root directory of
the engine source code (using
cd) and type:
C:\godot> scons platform=windows
When compiling with multiple CPU threads, SCons may warn about pywin32 being missing. You can safely ignore this warning.
If all goes well, the resulting binary executable will be placed in
C:\godot\bin\ with the name
godot.windows.tools.64.exe. By default, SCons will build a binary matching
your CPU architecture, but this can be overridden using
This executable file contains the whole engine and runs without any dependencies. Running it will bring up the Project Manager.
If you are compiling Godot for production use, then you can
make the final executable smaller and faster by adding the
If you are compiling Godot with MinGW, you can make the binary
even smaller and faster by adding the SCons option
As link-time optimization is a memory-intensive process,
this will require about 7 GB of available RAM while compiling.
If you want to use separate editor settings for your own Godot builds
and official releases, you can enable
Self-contained mode by creating a file called
_sc_ in the
Development in Visual Studio¶
Using an IDE is not required to compile Godot, as SCons takes care of everything. But if you intend to do engine development or debugging of the engine's C++ code, you may be interested in configuring a code editor or an IDE.
Folder-based editors don't require any particular setup to start working with Godot's codebase. To edit projects with Visual Studio they need to be set up as a solution.
You can create a Visual Studio solution via SCons by running SCons with
vsproj=yes parameter, like this: