[ November 2020 ]
Compiling with SCons command in Powershell.
Issue I ran into:
I installed Visual Studio Community 2019
+ installed the Visual Studio "Workload" named
Desktop development with C++.
I tried to compile Godot with
but got this error :
Cannot open include file: 'stddef.h': No such file or directory
Reinstalling Visual Studio's
Desktop development with C++ solved this, and Godot immediately compiled.
Here's the full recipe I used, hopefully this will save someone time:
Compiling Godot on Windows 10:
- Install Visual Studio Community 2019
- Install Visual Studio's
Desktop development with C++ Workload.
- during VS 2019 Installation :
Desktop development with C++ before you click
- or after VS 2019 is installed :
a. Click Start in the Windows Taskbar
b. Type "Visual Studio Installer" without quotes and hit enter.
c. Click "Modify" next to "Visual Studio Community 2019".
Desktop development with C++ on the "Workloads" tab.
e. Install by clicking
Modify in the bottom-right corner.
f. Close Visual Studio Installer when it's finished.
- Install Chocolatey https://chocolatey.org/install
- Open Powershell & run :
choco install python3
python -m pip install --upgrade pip
python -m pip install scons
choco install yasm
scons platform=windows -j6
( or if you only have a few cores in your CPU
scons platform=windows )
- Enjoy Godot!
You might need to close and open a fresh instance
of Powershell in between each command of step .
You don't have to use Chocolatey, but I've found it to be convenient, hassle-free, and a huge time-saver.
From https://docs.godotengine.org/en/3.2/development/compiling/compiling_for_windows.html?#selecting-a-compiler :
Docs : Development : Compiling : Compiling for Windows
"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 type
scons platform=windows after following the above steps, SCons will use Visual Studio to compile Godot. Add the
-j# parameter to the scons command to use multiple CPU threads.