Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile on windows with MinGW from scoop #48531

Open
paperjack93 opened this issue May 7, 2021 · 18 comments
Open

Unable to compile on windows with MinGW from scoop #48531

paperjack93 opened this issue May 7, 2021 · 18 comments

Comments

@paperjack93
Copy link

paperjack93 commented May 7, 2021

Godot version: bcbd480

OS/device including version: Windows 10

Issue description:
I cloned the project in C:/godot
I installed scoop and ran scoop install gcc python scons yasm make in my powershell
then I cd c:/godot in the folder and run scons platform=windows verbose=yes use_mingw=yes arch=x64
I receive the following error:

PS C:\godot> scons platform=windows verbose=yes use_mingw=yes arch=x64
scons: Reading SConscript files ...
Configuring for Windows: target=debug, bits=default
Using MinGW
Checking for C header file mntent.h... no
scons: done reading SConscript files.
scons: Building targets ...
[Initial build] g++ -o platform\windows\godot_windows.windows.tools.x64.o -c -std=gnu++17 -g3 -mwindows -Wall -Wshadow-local -Wno-misleading-indentation -Werror=return-type -DDEBUG_MEMORY_ALLOC -DDISABLE_FORCED_INLINE -DDEBUG_ENABLED -DWINDOWS_SUBSYSTEM_CONSOLE -DWINDOWS_ENABLED -DWASAPI_ENABLED -DWINMIDI_ENABLED -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DVULKAN_ENABLED -DMINGW_ENABLED -DMINGW_HAS_SECURE_API=1 -DTOOLS_ENABLED -DMINIZIP_ENABLED -DZSTD_STATIC_LINKING_ONLY -Ithirdparty\freetype\include -Ithirdparty\libpng -Ithirdparty\vulkan -Ithirdparty\vulkan\include -Ithirdparty\vulkan\loader -Ithirdparty\zstd -Ithirdparty\zlib -Iplatform\windows -I. platform\windows\godot_windows.cpp
=====
b''
=====
scons: *** [platform\windows\godot_windows.windows.tools.x64.o] Error 1
scons: building terminated because of errors.

I tried looking up information but I couldn't find anything. The error seems to be related to a char in godot_windows.cpp

@akien-mga
Copy link
Member

arch is not a valid argument for Windows, it's only used by macOS and iOS configs.
For Windows you should use bits=32 or bits=64 to pick x86 or x86_64.

I don't know if that's what causes your issue though.

@paperjack93
Copy link
Author

paperjack93 commented May 7, 2021

@akien-mga same error

PS C:\godot> scons platform=windows verbose=yes use_mingw=yes bits=64
scons: Reading SConscript files ...
Configuring for Windows: target=debug, bits=64
Using MinGW
Checking for C header file mntent.h... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
[Initial build] g++ -o platform\windows\godot_windows.windows.tools.64.o -c -std=gnu++17 -g3 -mwindows -Wall -Wshadow-local -Wno-misleading-indentation -Werror=return-type -DDEBUG_MEMORY_ALLOC -DDISABLE_FORCED_INLINE -DDEBUG_ENABLED -DWINDOWS_SUBSYSTEM_CONSOLE -DWINDOWS_ENABLED -DWASAPI_ENABLED -DWINMIDI_ENABLED -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DVULKAN_ENABLED -DMINGW_ENABLED -DMINGW_HAS_SECURE_API=1 -DTOOLS_ENABLED -DMINIZIP_ENABLED -DZSTD_STATIC_LINKING_ONLY -Ithirdparty\freetype\include -Ithirdparty\libpng -Ithirdparty\vulkan -Ithirdparty\vulkan\include -Ithirdparty\vulkan\loader -Ithirdparty\zstd -Ithirdparty\zlib -Iplatform\windows -I. platform\windows\godot_windows.cpp
=====
b''
=====
scons: *** [platform\windows\godot_windows.windows.tools.64.o] Error 1
scons: building terminated because of errors.```

@akien-mga
Copy link
Member

What's the output of scons --version?

@paperjack93
Copy link
Author

@akien-mga

SCons by Steven Knight et al.:
        SCons: v4.1.0.215860fd4f6bea67896c145660a035fad20cc41c, 2021-01-19 20:03:01, by bdbaddog on ProDog2020
        SCons path: ['C:\\Users\\User\\scoop\\apps\\scons\\4.1.0\\scons-local-4.1.0\\SCons']
Copyright (c) 2001 - 2021 The SCons Foundation```

@akien-mga
Copy link
Member

Then I have no clue what this b'' error is or comes from. The logs don't say much :(

@Zireael07
Copy link
Contributor

b'' to me looks like empty Python bytes object - what version of Python are you on @paperjack93 ? Might be some 2 vs 3 incompatibility...

@paperjack93
Copy link
Author

paperjack93 commented May 7, 2021

@Zireael07

python --version
Python 3.9.5

@GeorgeS2019
Copy link

GeorgeS2019 commented May 7, 2021

@Zireael07 setup a virtualenv for python and try again and use older python e.g. python 3.7, as the build script is more often tested with non 3.9 version python

@paperjack93
Copy link
Author

paperjack93 commented May 7, 2021

@Zireael07 setup a virtualenv for python and try again and use older python e.g. py0thon 3.7, as the build script is more often tested with non 3.9 version python

I tried with python 3.7.2 and it gives same error

@GeorgeS2019
Copy link

GeorgeS2019 commented May 7, 2021

@Zireael07 Do u use virtualenv? I use VisualStudio2019 c++ building on regular basis
Your scon path is outside a virtualenv

I did not follow this step
scoop install gcc python scons yasm make

@paperjack93
Copy link
Author

I don't use visualstudio or virtualenv @GeorgeS2019

@akien-mga
Copy link
Member

@GeorgeS2019 This issue is about compiling with MinGW-GCC from scoop's distribution, Visual Studio is a completely different compiler so it's not relevant to this issue.

@akien-mga akien-mga changed the title Unable to compile on windows, error 1 Unable to compile on windows with MinGW from scoop May 7, 2021
@Calinou
Copy link
Member

Calinou commented May 7, 2021

As a workaround, you can install llvm-mingw, add its bin folders to your user's PATH environment variable, open a new command prompt (or reboot if you added it to your system PATH), and compile with scons use_mingw=yes use_llvm=yes use_lld=yes.

I think there are 2 folders to add in your PATH with llvm-mingw, but I can't check right now.

@paperjack93
Copy link
Author

@Calinou do I have to remove the mingw from scoop ?

@paperjack93
Copy link
Author

@Calinou I tried it and the error changed:

PS C:\godot> scons platform=windows verbose=yes use_mingw=yes bits=64
scons: Reading SConscript files ...
Configuring for Windows: target=debug, bits=64
Using MinGW
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] gcc-ar q main\libmain.windows.tools.64.a main\main.windows.tools.64.o main\main_timer_sync.windows.tools.64.o main\performance.windows.tools.64.o
scons: *** [main\libmain.windows.tools.64.a] The system cannot find the file specified
scons: building terminated because of errors.
PS C:\godot>

@Xrayez
Copy link
Contributor

Xrayez commented May 7, 2021

@paperjack93 don't forget to add use_llvm=yes along with use_mingw=yes. Otherwise, it fails to find needed tools according to above log.

@Calinou
Copy link
Member

Calinou commented May 7, 2021

@Calinou do I have to remove the mingw from scoop ?

You don't have to, but you have to make sure llvm-mingw is above the MinGW Scoop paths in the PATH editor.

Still, you can try removing it as a last resort with scoop uninstall gcc.

@paperjack93
Copy link
Author

@Calinou I managed to compile successfully thanks to your workaround
@Xrayez thank you for the info! The use_llvm=yes was missing.
The problem with the scoop b'' remains, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants