+2 votes

When I type: scons -j6 platform=windows target=release_debug

I get this error:

C:\Users\Burak\Desktop\Build Godot\godot>scons -j6 platform=windows target=release_debug
scons: Reading SConscript files ...
Configuring for Windows: target=release_debug, bits=default
Found MSVC compiler: amd64
Compiled program architecture will be a 64 bit executable (forcing bits=64).
Missing environment variable: WindowsSdkDir
Missing environment variable: WindowsSdkDir
YASM is necessary for WebM SIMD optimizations.
WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!
Checking for C header file mntent.h... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
[Initial build] [94mCompiling [95m==> [93mplatform\windows\godot_windows.cpp[0m
[Initial build] [94mCompiling [95m==> [93mplatform\windows\camera_win.cpp[0m
[Initial build] [94mCompiling [95m==> [93mplatform\windows\context_gl_windows.cpp[0m
godot_windows.cpp
camera_win.cpp
context_gl_windows.cpp
[Initial build] [94mCompiling [95m==> [93mplatform\windows\crash_handler_windows.cpp[0m
crash_handler_windows.cpp
[Initial build] C:\Users\Burak\Desktop\Build Godot\godot\core/typedefs.h(34): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
C:\Users\Burak\Desktop\Build Godot\godot\core/math/random_pcg.h(34): fatal error C1083: Cannot open include file: 'math.h': No such file or directory
[Initial build] [94mCompiling [95m==> [93mplatform\windows\os_windows.cpp[0m
[Initial build] [94mCompiling [95m==> [93mplatform\windows\key_mapping_windows.cpp[0m
os_windows.cpp
key_mapping_windows.cpp
scons: *** [platform\windows\godot_windows.windows.opt.tools.64.obj] Error 2
scons: *** [platform\windows\camera_win.windows.opt.tools.64.obj] Error 2
C:\Users\Burak\Desktop\Build Godot\godot\core/typedefs.h(34): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
C:\Users\Burak\Desktop\Build Godot\godot\core/typedefs.h(34): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
scons: *** [platform\windows\context_gl_windows.windows.opt.tools.64.obj] Error 2
scons: *** [platform\windows\key_mapping_windows.windows.opt.tools.64.obj] Error 2
C:\Users\Burak\Desktop\Build Godot\godot\core/typedefs.h(34): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
scons: *** [platform\windows\os_windows.windows.opt.tools.64.obj] Error 2
C:\Users\Burak\Desktop\Build Godot\godot\platform\windows\crash_handler_windows.h(34): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
scons: *** [platform\windows\crash_handler_windows.windows.opt.tools.64.obj] Error 2
scons: building terminated because of errors.

I installed Windows SDK and created System variable Name: WindowsSdkDir Value: C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
But I still get this error...

in Engine by (19 points)

Did you install Visual Studio as specified in these docs?

1 Answer

0 votes

[ November 2020 ]

Windows 10.
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 scons platform=windows
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:


  1. Install Visual Studio Community 2019
    https://visualstudio.microsoft.com/vs/community/ .

  2. Install Visual Studio's Desktop development with C++ Workload.


    • during VS 2019 Installation :
      Click Desktop development with C++ before you click Install
    • 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".
      d. Click 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.

  3. Install Chocolatey https://chocolatey.org/install

  4. 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 )

  5. Enjoy Godot!


You might need to close and open a fresh instance
of Powershell in between each command of step [4]
.

You don't have to use Chocolatey, but I've found it to be convenient, hassle-free, and a huge time-saver.



More Info:

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.

by (38 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.