ungoogled-software / ungoogled-chromium-windows

Windows packaging for ungoogled-chromium
BSD 3-Clause "New" or "Revised" License
1.09k stars 111 forks source link

Win10 x64, vs2019, msvcrt not found error (upd. How to choose vs 2019 instead of 2022) #135

Closed kv-gits closed 2 years ago

kv-gits commented 2 years ago

Try all steps to build but get error

    assert optional, "%s is not found in %s:\n%s\nCheck if it is installed." % (
AssertionError: msvcrt.lib is not found in LIB:
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86
C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86
C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x86

Tried to google this issue and install some additional packages - same result.

kv-gits commented 2 years ago

Handled with running vc2019 developer console, not trivial command prompt

kv-gits commented 2 years ago

If I run developer prompt, there is also other issue, "user32.lib not found". Vs installed in standard path

kv-gits commented 2 years ago

Created bat script

SET GYP_MSVS_VERSION = 2019
SET DEPOT_TOOLS_WIN_TOOLCHAIN = 0
SET LIB="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\lib\x64;C:\Program Files 
(x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\lib\x86"
py build.py

msvcrt error resolved, but Found in logs that script calls vcvars from VS2022, but not VS2019. I have to versions of VS on machine,

E:\src_builds\chromium\ungoogled-chromium-windows\build\src>call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" >nul

GYP_MSVS_VERSION 2019 ignored and other errors appears.

“ninja: error: loading 'build.ninja': The system cannot find the file specified
kv-gits commented 2 years ago

build.py choose vs2022 vsvars.bat instead of 2019.

result = subprocess.run(
        '"{}" -prerelease -version [15^,17^) -property installationPath'.format(vswhere_exe),
        shell=True,
        check=True,
        stdout=subprocess.PIPE,
        universal_newlines=True)

This code helps choose right version