'MSVC LINK : fatal error LNK1104: cannot open file “msvcprt.lib”

I want to compile a cpp file with cl.exe
Command line: cl main.cpp /Fe:test.exe /O2 /std:c++17 /MD
But an error occurred during linking LINK : fatal error LNK1104: cannot open file “msvcprt.lib”
It was normal before updating VS 2019 to 2022
And if I copy the libs to my root directory, it will be built successfully
I have added the directory to the environment variable Path like this:
IMAGE:Path



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source