Failed to generate godot.sln

Godot Version

godot 4.2 latest source code in master branch.

Question

I failed to generate godot.sln with the error below:

C:\Users\F_CIL\Project\Godot>scons p=windows vsproj=yes
scons: Reading SConscript files ...
Auto-detected 12 CPU cores available for build parallelism. Using 11 cores by default. You can override it with the -j argument.
Using MinGW, arch x86_64
Building for platform "windows", architecture "x86_64", target "editor".
TypeError: 'NoneType' object is not iterable:
  File "C:\Users\F_CIL\Project\Godot\SConstruct", line 991:
    methods.generate_vs_project(env, ARGUMENTS, env["vsproj_name"])
  File "C:\Users\F_CIL\Project\Godot\methods.py", line 780:
    batch_file = find_visual_c_batch_file(env)
  File "C:\Users\F_CIL\Project\Godot\methods.py", line 721:
    (host_platform, target_platform, _) = get_host_target(env, msvc_version)
  File "C:\Users\F_CIL\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\SCons\Tool\MSCommon\vc.py", line 560:
    vernum = float(get_msvc_version_numeric(msvc_version))
  File "C:\Users\F_CIL\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\SCons\Tool\MSCommon\vc.py", line 504:
    return ''.join([x for x in msvc_version if x in string_digits + '.'])

I use the latest code in master branch, how can I deal with this error?

The ‘Python’ I used is dowload from Microsoft Store with version is 3.12.1.
And the version of scons is:

C:\Users\F_CIL\Project\Godot>scons --version
SCons by Steven Knight et al.:
        SCons: v4.6.0.e5eef322a4a727b96358a436dca46e8085ac8692, Sun, 19 Nov 2023 17:22:20 -0700, by bdbaddog on M1Dog2021
        SCons path: ['C:\\Users\\F_CIL\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python312\\site-packages\\SCons']
Copyright (c) 2001 - 2023 The SCons Foundation

I have found that the msvc_version is None. But I dont know how to specify the use of MSVC(I see in the first line of the log ‘Using MinGW’)
After I remove the PATH of MinGW, I got another error:

PS C:\Users\F_CIL\Project\Godot> scons platform=windows vsproj=yes
scons: Reading SConscript files ...
Auto-detected 12 CPU cores available for build parallelism. Using 11 cores by default. You can override it with the -j argument.

            No valid compilers found, use MINGW_PREFIX environment variable to set MinGW path.

The scons can’t find msvc, but I’ve upgraded the scons to the latest as the docs say.
I used Visual Studio 2022 preview, maybe the version of vs is too new?

After I download VS2019, all the difficulties were solved.
Now I’m confused that the scons can’t find msvc is because of the problem with the scons itself, or is the SContruct file not written properly? As far as I can tell, the installation directory for vs2022 is under Program Files, while the pervious version(such as vs2019) was installed under Program Files(x86) folder.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.