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

Windows MINGW Build enable_virtual_terminal_processing not found #58595

Open
m21-cerutti opened this issue Feb 27, 2022 · 12 comments · Fixed by RebelToolbox/RebelEngine#23
Open

Comments

@m21-cerutti
Copy link

m21-cerutti commented Feb 27, 2022

Godot version

3.4.3-stable

System information

Windows 10 / MINGW 8.1.0 / Intel Core i7-8700 AMD64

Issue description

When trying to compile with MINGW from sources, there is an error during the process.
I have verified that Visual Studio have installed Window SDK 10, and all the recommendation from the documentation.
I have also gcc that is in the PATH (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0

The error:

+ scons platform=windows bits=64 use_mingw=yes -j9
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 ...
Compiling ==> platform\windows\os_windows.cpp
...
Compiling ==> thirdparty\bullet\BulletCollision\NarrowPhaseCollision\btPersistentManifold.cpp
=====
b"platform\\windows\\os_windows.cpp: In member function 'bool OS_Windows::_is_win11_terminal() const':\nplatform\\windows\\os_windows.cpp:2236:21: error: 'ENABLE_VIRTUAL_TERMINAL_PROCESSING' was not declared in this scope\n   return ((dwMode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) == ENABLE_VIRTUAL_TERMINAL_PROCESSING);\n                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nplatform\\windows\\os_windows.cpp:2236:21: note: suggested alternative: 'MM_SPECTRUM_SIGNAL_PROCESSING'\n   return ((dwMode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) == ENABLE_VIRTUAL_TERMINAL_PROCESSING);\n                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n                     MM_SPECTRUM_SIGNAL_PROCESSING\n"
=====
Compiling ==> thirdparty\bullet\BulletCollision\NarrowPhaseCollision\btRaycastCallback.cpp
Compiling ==> thirdparty\bullet\BulletCollision\NarrowPhaseCollision\btSubSimplexConvexCast.cpp
Compiling ==> thirdparty\bullet\BulletCollision\NarrowPhaseCollision\btVoronoiSimplexSolver.cpp
Compiling ==> thirdparty\bullet\BulletCollision\NarrowPhaseCollision\btPolyhedralContactClipping.cpp
scons: *** [platform\windows\os_windows.windows.tools.64.o] Error 1
Compiling ==> thirdparty\bullet\BulletDynamics\Character\btKinematicCharacterController.cpp
scons: building terminated because of errors.
[Time elapsed: 00:00:10.590]

Steps to reproduce

Try to compile with my configuration and this script :

#!/bin/bash -e
mkdir -p ./GodotEngine
cd ./GodotEngine
myRepo=$(pwd)

VERSION=3.4.3-stable
CORES=9

echo "Version $VERSION"

if [  ! -d "$myRepo/godot"  ]; then
    echo "cloning godot"
    git clone --branch $VERSION https://github.com/godotengine/godot
else
    cd godot
    git checkout $VERSION
    cd ..
fi

pushd godot
set -x
scons platform=windows bits=64 use_mingw=yes -j$CORES

setx GODOT_DIR "$myRepo\godot"
setx GODOT_BUILD "bin"
echo "Add %GODOT_DIR% to user environment path."
popd

Minimal reproduction project

No response

@m21-cerutti m21-cerutti changed the title enable_virtual_terminal_processing not found with Windows MINGW Windows MINGW Build enable_virtual_terminal_processing not found Feb 27, 2022
@bruvzg
Copy link
Member

bruvzg commented Feb 27, 2022

have verified that Visual Studio have installed Window SDK 10, and all the recommendation from the documentation.

MinGW do not use Windows SDK or Visual Studio in any way.

I have also gcc that is in the PATH (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0

GCC version is irrelevant, but GCC 8.x is 4 years old and might be shipped with the old MinGW headers 6.0.0.

ENABLE_VIRTUAL_TERMINAL_PROCESSING should be available in the MinGW headers 7.0.0+ (current version is 9.0.0).

@m21-cerutti
Copy link
Author

Sorry i made a mistake, it was the MingW version that is 8.0.1.

@akien-mga
Copy link
Member

ENABLE_VIRTUAL_TERMINAL_PROCESSING should be available in the MinGW headers 7.0.0+ (current version is 9.0.0).

I can confirm, here's the commit which added it: mirror/mingw-w64@1b29d1b
It's included in 7.0.0 onwards.

Sorry i made a mistake, it was the MingW version that is 8.0.1.

Does adding #include <wincon.h> in platform/windows/os_windows.cpp fix it for you?

If not, can you check if your MinGW's sys-root/mingw/include/wincon.h has a definition for ENABLE_VIRTUAL_TERMINAL_PROCESSING?

@akien-mga akien-mga added this to the 3.5 milestone Mar 7, 2022
@bruvzg
Copy link
Member

bruvzg commented Mar 7, 2022

Does adding #include <wincon.h>

Including windows.h should be enough, but I guess WIN32_LEAN_AND_MEAN might work differently on MinGW and MSVC, include it should not cause any issues on both. Probably we can add the header directly.

@m21-cerutti
Copy link
Author

m21-cerutti commented Mar 7, 2022

Thanks for your response, adding wincon.h or windows.h have not worked, and for Mingw i have maybe a begining of answer.

My wincon.h is was in C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\include , and doesn't contain a definition for ENABLE_VIRTUAL_TERMINAL_PROCESSING.
Since it appears suspect i have reinstalled mingw64 with now with this configuration from https://sourceforge.net/projects/mingw-w64/
2022_03_07_19-42-53_Installing_MinGW-W64

But no definition again for ENABLE_VIRTUAL_TERMINAL_PROCESSING.
I think for this problem it's because i don't have build from the sources of mingw but it seems weird.

@bruvzg
Copy link
Member

bruvzg commented Mar 7, 2022

https://sourceforge.net/projects/mingw-w64/
Source: README.rst, updated 2018-05-24

There are recent files in this repo, but the installer seems to be outdated (if it's from 2018, most likely it is MinGW v6.0.0 or v5.0.4 with GCC 8.1.0). There's no MinGW 8.1.0 release at all - see https://www.mingw-w64.org/changelog/

I would suggest using https://www.msys2.org/ to install MinGW.

@m21-cerutti
Copy link
Author

Ok seems it has solve the problem. Thanks you !
Maybe it would be nice to add it to the documentation ? Maybe some kind of verification or warning about the MingW version needed like for the posix thread model ?

@piiertho
Copy link
Contributor

Don’t know if it is linked, as we don’t use mingwin, but we experience same error on latest windows GitHub runner: https://github.com/utopia-rise/godot-kotlin-jvm/runs/5588451500?check_suite_focus=true

@bruvzg
Copy link
Member

bruvzg commented Mar 19, 2022

Don’t know if it is linked, as we don’t use mingwin

From this log, it's clear that it is using MinGW. Even if you have not specified use_mingw for the scons it will use it if MinGW is found and Visual Studio is not.

@piiertho
Copy link
Contributor

piiertho commented Mar 19, 2022

Don’t know if it is linked, as we don’t use mingwin

From this log, it's clear that it is using MinGW. Even if you have not specified use_mingw for the scons it will use it if MinGW is found and Visual Studio is not.

Oh thanks ! Never noticed the using mingwin log on our jobs.

EDIT: here is a previous log on our side: https://github.com/utopia-rise/godot-kotlin-jvm/runs/4828315772?check_suite_focus=true
It was using MSVC as default. So it seems default behaviour on GitHub runners has changed.
This won’t cause trouble to this repo CI ?

@GKxxUCAS
Copy link

@bruvzg Is there a predefined macro that can tell the version of the mingw headers?

@akien-mga
Copy link
Member

@bruvzg Is there a predefined macro that can tell the version of the mingw headers?

#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR >= 7

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

Successfully merging a pull request may close this issue.

7 participants