Or, to use them in a developer command prompt that is pre-configured:
| Switch | Purpose | |--------|---------| | /arch:IA32 | x86: disable SSE/MMX (use legacy x87) | | /arch:SSE2 | x86: default for v142 (SSE2 instructions) | | /arch:AVX2 | x86/x64: enable AVX2 | | /GL | Whole program optimization (LTCG) | | /MT or /MD | Static or dynamic CRT linkage | | /std:c++17 or /std:c++20 | Language standard | | /GS | Buffer security check | | /sdl | Additional security checks | msvc v142 - vs 2019 c++ x64/x86 build tools
| Architecture | Toolset Subfolder | Platform Environment Variable | Notes | |--------------|------------------|-------------------------------|-------| | (32-bit) | Hostx86\x86 | vsvars32.bat | Builds 32-bit code, runs on x86/x64 Windows | | x64 (64-bit) | Hostx64\x64 | vcvars64.bat | Builds 64-bit native code | | x86-on-x64 (cross) | Hostx64\x86 | vcvarsamd64_x86.bat | 64-bit host compiler emits 32-bit output (faster large builds) | | x64-on-x86 (cross) | Hostx86\x64 | vcvarsx86_amd64.bat | 32-bit host → 64-bit output (legacy, slower) | Or, to use them in a developer command
Even if you have the latest version of Visual Studio (like 2022), you might still need the v142 build tools for several reasons: msvc v142 - vs 2019 c++ x64/x86 build tools
If you are a developer who prefers VS Code or needs to set up a Build Server: