0 votes

I’m trying to compile godot in Windows following the instruction of http://docs.godotengine.org/en/latest/development/compiling/compiling_for_windows.html
However I’m getting the following error

C:\godot>scons platform=windows scons: Reading SConscript files ...

MSVC not detected, attempting MinGW.
- gcc detected. ('translations: ', ['C:\godot\editor/translations\ar.po',
'C:\godot\editor/translations\bg.po', 'C:\godot\editor/translations\bn.po', 'C:\godot\editor/translations\ca.po', 'C:\godot\editor/translations\cs.po', 'C:\godot\editor/translations\da.po', 'C:\godot\editor/translations\de.po', 'C:\godot\editor/translations\deCH.po', 'C:\godot\editor/translations\el.po', 'C:\godot\editor/translations\es.po', 'C:\godot\editor/translations\esAR.po', 'C:\godot\editor/translations\fa.po', 'C:\godot\editor/translations\fi.po', 'C:\godot\editor/translations\fr.po', 'C:\godot\editor/translations\hu.po', 'C:\godot\editor/translations\id.po', 'C:\godot\editor/translations\it.po', 'C:\godot\editor/translations\ja.po', 'C:\godot\editor/translations\ko.po', 'C:\godot\editor/translations\nb.po', 'C:\godot\editor/translations\nl.po', 'C:\godot\editor/translations\pl.po', 'C:\godot\editor/translations\pr.po', 'C:\godot\editor/translations\ptBR.po', 'C:\godot\editor/translations\ptPT.po', 'C:\godot\editor/translations\ru.po', 'C:\godot\editor/translations\sk.po', 'C:\godot\editor/translations\sl.po', 'C:\godot\editor/translations\th.po', 'C:\godot\editor/translations\tr.po', 'C:\godot\editor/translations\urPK.po',
CN.po', 'C:\godot\editor/translations\zhHK.po',
TW.po']) ('fonts: ',
scons: done reading SConscript files. scons: Building targets ...
[Initial build] Compiling ==> platform\windows\oswindows.cpp
===== In file included from platform\windows\os
windows.cpp:41:0: platform\windows\joypad.h:35:20: fatal error: dinput.h: No such file
or directory compilation terminated.

===== scons: *** [platform\windows\os_windows.windows.tools.64.o] Error 1 scons: building terminated because of errors.

I think the problem with
fatal error: dinput.h: No such file or directory
is a problem with the visual studio installation. I understand that I need to use visual studio 2015 (not 2017) I download visual studio 2015 from http://landinghub.visualstudio.com/visual-cpp-build-tools, but some of the files are missing from that visual studio option.
Or the problem could be that SCons is not able to locate environment variables of Visual C++.
Does anybody knows how to solve this problem?
The objective of all this is to use godot from the Qt program

in Engine by (23 points)
edited by

1 Answer

+2 votes
Best answer

Before compiling Godot using the Visual Studio C++ compiler, you need to initialize its environment variables. This can be done either by using the start menu entries created by Visual Studio, for example, by starting x64 Native Tools Command Prompt for VS 2017 (for Visual Studio 2017), navigating to the Godot source directory, then issuing the scons platform=windows command.

Alternatively, you can open a command prompt, then call a .bat file that will initialize the C++ compiler (the following commands are valid for 64-bit Windows installations, using the default Visual Studio path):

  • For Visual Studio 2017:

    call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=x64
  • For Visual Studio 2015:

    call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

Additionally, Godot can be compiled with either MSVC 2017 or MSVC 2015, both are supported (I've been using MSVC 2017 for a few months now, and it compiles Godot just fine). Also, Visual Studio 2017 does have an option to install only the C++ tools, as part of the default installer (it's no longer a separate download).

by (9,362 points)
selected by


call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=x64

Needs to go into the docs.

I have tried exactly what you have suggested and I get this error "file: 'gdnative/string.h'"

Any idea how to fix this @calinou?

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 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 webmaster@godotengine.org with your username.