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

SConstruct script in main branch is broken on windows #92065

Closed
LUK3D opened this issue May 18, 2024 · 3 comments · Fixed by #92087
Closed

SConstruct script in main branch is broken on windows #92065

LUK3D opened this issue May 18, 2024 · 3 comments · Fixed by #92087

Comments

@LUK3D
Copy link

LUK3D commented May 18, 2024

Tested versions

  • Reproducible in: Master brach

System information

Windows 11 - Godot Master branch

Issue description

I just started learning C++ and I was trying to build a visual studio solution from Godot using scons by following the documentation but I got an error when running scons p=windows vsproj=yes.
This is the error message:

bash
scons: Reading SConscript files ...
ArgumentError: argument 1: <class 'TypeError'>: wrong type:
  File "D:\projects\cpp_experiments\godot\SConstruct", line 23:
    stdout_handle = windll.kernel32.GetStdHandle(c_int(-11))

The problem sims to be on this code, but I don't know how to fix it because I'm new to cpp and this is something that I don't understand yet.

if sys.platform == "win32":
    from ctypes import windll, c_int, byref
    

    stdout_handle = windll.kernel32.GetStdHandle(c_int(-11))
    mode = c_int(0)
    windll.kernel32.GetConsoleMode(c_int(stdout_handle), byref(mode))
    mode = c_int(mode.value | 4)
    windll.kernel32.SetConsoleMode(c_int(stdout_handle), mode)

Steps to reproduce

Clone the master branch and run scons p=windows vsproj=yes

Minimal reproduction project (MRP)

The godot source code

@LUK3D LUK3D changed the title scons platform=windows and scons platform=windows vsproj=yes not working SConstruct script in main branch is broken on windows May 18, 2024
@huwpascoe
Copy link

if sys.platform == "win32":
    from ctypes import windll, c_int, byref
    

    stdout_handle = windll.kernel32.GetStdHandle(c_int(-11))
    mode = c_int(0)
    windll.kernel32.GetConsoleMode(c_int(stdout_handle), byref(mode))
    mode = c_int(mode.value | 4)
    windll.kernel32.SetConsoleMode(c_int(stdout_handle), mode)

if you comment out that offending block of code in the SConstruct file, what new (if any) errors occur?

@LUK3D
Copy link
Author

LUK3D commented May 18, 2024

if sys.platform == "win32":
    from ctypes import windll, c_int, byref
    

    stdout_handle = windll.kernel32.GetStdHandle(c_int(-11))
    mode = c_int(0)
    windll.kernel32.GetConsoleMode(c_int(stdout_handle), byref(mode))
    mode = c_int(mode.value | 4)
    windll.kernel32.SetConsoleMode(c_int(stdout_handle), mode)

if you comment out that offending block of code in the SConstruct file, what new (if any) errors occur?

If I comment that code, the command works.
I'm using it that way for now.

@akien-mga akien-mga added the bug label May 18, 2024
@akien-mga akien-mga added this to the 4.3 milestone May 18, 2024
@akien-mga
Copy link
Member

CC @Repiteo

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

Successfully merging a pull request may close this issue.

4 participants