1. Information

  • See https://gist.github.com/Mr-Precise/9967e3fcf03f2df0282b76841d2f3876.

    Product Name                    Version         Release Date
    ------------                    -------         ------------
    Visual Studio Version 2010      10.x            2010-04-12
    Visual Studio Version 2012      11.x            2012-09-12
    Visual Studio Version 2013      12.x            2013-10-17
    Visual Studio Version 2015      14.x            2015-07-20
    Visual Studio Version 2017      15.x            2017-03-07
    Visual Studio Version 2019      16.x            2019-04-02
    Visual Studio Version 2022      17.x            2021-11-08

Windows XP Support: Microsoft ended support for Windows XP on April 8, 2014. Current versions of the Visual C Redistributable for Visual Studio 2015-2022 only support Windows 7, 8.1, 10, and 11. The last version of the Visual C Redistributable that works on Windows XP shipped in Visual Studio 2019 version 16.7 (file versions starting with 14.27). The Redistributable is available in the my.visualstudio.com Downloads section as Visual C++ Redistributable for Visual Studio 2019 (version 16.7). Use the Search box to find this version. To download the files, select the platform and language you need, and then choose the Download button.

The documentation at https://learn.microsoft.com/en-us/cpp/build/configuring-programs-for-windows-xp?view=msvc-170&source=docs says "The toolset supplied in Visual Studio 2019 and later doesn’t include support for creating code for Windows XP. Support for Windows XP development is available by using the Visual Studio 2017 v141_xp toolset. You can install the v141_xp toolset as an individual component option in the Visual Studio Installer."

*sfx-Modules (Self-Extractor)
  SFXCon 7zCon.sfx: Console 7z SFX module
  SFXWin 7z.sfx: Windows 7z SFX module
  SFXSetup 7zS.sfx: Windows 7z SFX module for Installers
Visual Studio Version   7z920   7z1604  7z1900  7z2301  7z2409
---------------------   -----   ------  ------  ------  ------
VS 2010 32-bit-winxp    OK      OK      OK      OK      OK
VS 2010 32-bit                                          OK
VS 2010 64-bit                                          OK

VS 2013 32-bit-winxp    nmake   exe     exe     nmake   nmake
VS 2013 32-bit          nmake                   nmake   nmake
VS 2013 64-bit          .       .       .       nmake   nmake

VS 2015 32-bit-winxp    nmake   exe     exe     exe     exe
VS 2015 32-bit          nmake   .       .       .       .
VS 2015 64-bit          .       .       .       .       .

VS 2017 32-bit-winxp
VS 2017 32-bit
VS 2017 64-bit

VS 2019 32-bit-winxp
VS 2019 32-bit
VS 2019 64-bit

VS 2022 32-bit-winxp                                    exe
VS 2022 32-bit                                          OK
VS 2022 64-bit                                          OK
grep -ir 'visual studio.*20' /home/Other/Inventory |
  grep -Eiv '_Deleted|_Donated|_Lab|_Obsolete|_Recycled|_VirtualBox|\.txt|Crystal|Prerequisites|Shell|Tools|XAML'
/home/Other/Inventory/MRM/SMRUNB-DM01.log:Microsoft Visual Studio:              Visual Studio Community 2022 {17.10.5} [32~bit]
/home/Other/Inventory/MRM/TBHFWS-IT01.log:Microsoft Visual Studio:              Visual Studio Community 2022 {17.2.3} [32~bit]
/home/Other/Inventory/MRM/TBHFWS-IT01.log:Microsoft Visual Studio:              Visual Studio Professional 2022 (3) {17.12.4} [32~bit]
/home/Other/Inventory/MRM/TBHFWS-IT01.log:Microsoft Visual Studio Installer:    Microsoft Visual Studio Installer {3.12.2320.19252} [64~bit]

2. Visual Studio 2010

2.1. Installation

  • Note: Visual Studio 2010 checks against the registry, preventing a complete loading of the software if the version of NET 4 is too high.

  • Temporarily modify the registry keys that Visual Studio 2010 checks against.

  • Enter the following commands at a Command Prompt with administrative privileges.

    reg.exe query "HKLM\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Client" /v Version
    reg.exe query "HKLM\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Full"   /v Version
    # Write down the version numbers.
    # Windows 10: 4.8.04084
    # Windows 10: 4.8.09037
    # Windows 11: 4.8.09032
    
    # Get a Command Prompt with system privileges.
    Open-TrustedInstaller
    reg.exe add "HKLM\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Client" /v Version /d 4.0.30319 /f
    reg.exe add "HKLM\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Full"   /v Version /d 4.0.30319 /f
  • Right-click W:\Software\Microsoft\Visual Studio\Visual Studio 2010\SW_DVD9_VS_Ultimate_2010_English_Core_MLF_X16-76630.ISO and select Open with > Windows Explorer.

  • Run the Setup.exe file with administrative privileges.

  • Select Install Microsoft Visual Studio 2010.

  • Uncheck Yes, send information about my setup experiences tO Micorsoft Corporation.

  • Click Next.

  • Choose I have read and accept the license terms.

  • Choose Full.

  • Click Install.

  • Wait for about 30 minutes for the installation to finish.

  • Note: The following component failed to install: Microsoft SQL Server 2008 Express Service Pack 1 (x64)

  • Click Finish.

  • Click Exit.

  • Right-click W:\Software\Microsoft\Visual Studio\Visual Studio 2010\mu_visual_studio_2010_sp1_x86_dvd_651704.iso and select Open with > Windows Explorer.

  • Run the Setup.exe file with administrative privileges.

  • Click Next.

  • Check I have read and accept the license terms.

  • Click Install.

  • Click Finish.

  • Right-click W:\Software\Microsoft\Visual Studio\Visual Studio 2010\sdk_7.1_x64.iso and select Open with > Windows Explorer.

  • Run the Setup.exe file with administrative privileges.

  • Click Next.

  • Choose I agree.

  • Click Next.

  • Click Next.

  • Click Next.

  • Click Next.

  • Click Next.

  • Uncheck View the Windows SDK Release Notes.

  • Click Finish.

  • Extract the contents of the W:\Software\Microsoft\Visual Studio\Visual Studio 2010\vs_2010_sp1_x86_updates.zip to the C:\Tmp\vs_2010_sp1_x86_updates folder.

  • Run the Update.bat file with administrative privileges.

  • Enter the following commands at a Command Prompt with administrative privileges.

    # Get a Command Prompt with system privileges.
    Open-TrustedInstaller
    reg.exe add "HKLM\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Client" /v Version /d 4.8.04084 /f
    reg.exe add "HKLM\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Full"   /v Version /d 4.8.04084 /f
    reg.exe add "HKLM\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Client" /v Version /d 4.8.09037 /f
    reg.exe add "HKLM\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Full"   /v Version /d 4.8.09037 /f

2.2. Usage

  • Download the 7z920.tar.bz2 file and extract the contents to the C:\Tmp\7z920 folder.

  • Download the 7z1604-src.7z file and extract the contents to the C:\Tmp\1604 folder.

  • Download the 7z1900-src.7z file and extract the contents to the C:\Tmp\1900 folder.

  • Download the 7z2301-src.7z file and extract the contents to the C:\Tmp\2301 folder.

  • Download the 7z2409-src.7z file and extract the contents to the C:\Tmp\2409 folder.

  • Remove the -OPT:NOWIN98 string from the C:\Tmp\7z920\CPP\Build.mak file.

  • Remove the -OPT:NOWIN98 string from the C:\Tmp\7z1604\CPP\Build.mak file.

  • Select the C:\Tmp\7z920\CPP\7zip\Bundles\SFXSetup folder.

  • Select the C:\Tmp\7z1604\CPP\7zip\Bundles\SFXSetup folder.

  • Select the C:\Tmp\7z1900\CPP\7zip\Bundles\SFXSetup folder.

  • Select the C:\Tmp\7z2301\CPP\7zip\Bundles\SFXSetup folder.

  • Select the C:\Tmp\7z2409\CPP\7zip\Bundles\SFXSetup folder.

  • Select Start > Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio Command Prompt (2010).

    cd C:\Tmp\7z920\CPP\7zip\Bundles\SFXSetup
    rmdir /q /s O
    nmake
    
    copy /y O\7zS.sfx C:\Tmp\7zS-920-x86.sfx
    copy /y O\7zS.sfx C:\Tmp\7zSConsole-920-x86.sfx
    editbin.exe C:\Tmp\7zSConsole-920-x86.sfx /subsystem:console
    fc.exe /b C:\Tmp\7zS-920-x86.sfx C:\Tmp\7zSConsole-920-x86.sfx
    rmdir /q /s O
    exit
    cd C:\Tmp\7z1604\CPP\7zip\Bundles\SFXSetup
    rmdir /q /s O
    nmake
    
    copy /y O\7zS.sfx C:\Tmp\7zS-1604-x86.sfx
    copy /y O\7zS.sfx C:\Tmp\7zSConsole-1604-x86.sfx
    editbin.exe C:\Tmp\7zSConsole-1604-x86.sfx /subsystem:console
    fc.exe /b C:\Tmp\7zS-1604-x86.sfx C:\Tmp\7zSConsole-1604-x86.sfx
    rmdir /q /s O
    exit
    cd C:\Tmp\7z1900\CPP\7zip\Bundles\SFXSetup
    rmdir /q /s o
    nmake
    
    copy /y O\7zS.sfx C:\Tmp\7zS-1900-x86.sfx
    copy /y O\7zS.sfx C:\Tmp\7zSConsole-1900-x86.sfx
    editbin.exe C:\Tmp\7zSConsole-1900-x86.sfx /subsystem:console
    fc.exe /b C:\Tmp\7zS-1900-x86.sfx C:\Tmp\7zSConsole-1900-x86.sfx
    rmdir /q /s o
    exit
    cd C:\Tmp\7z2301\CPP\7zip\Bundles\SFXSetup
    rmdir /q /s o
    nmake
    
    copy /y O\7zS.sfx C:\Tmp\7zS-2301-x86.sfx
    copy /y O\7zS.sfx C:\Tmp\7zSConsole-2301-x86.sfx
    editbin.exe C:\Tmp\7zSConsole-2301-x86.sfx /subsystem:console
    fc.exe /b C:\Tmp\7zS-2301-x86.sfx C:\Tmp\7zSConsole-2301-x86.sfx
    rmdir /q /s o
    exit
  • Select the C:\Tmp\7z2409\CPP\7zip\Bundles\SFXSetup folder.

  • Make a copy of the SfxSetup.cpp file and rename it SfxSetup.cpp.org.

  • See https://sourceforge.net/p/sevenzip/discussion/45797/thread/28884697.

  • See https://github.com/samyakranjan/LZMA-SDK/releases/tag/1900-SfxSetup.

  • Make the following changes to the SfxSetup.cpp file to fix exit code always being zero.

      if (hProcess)                                                   if (hProcess)
      {                                                               {
        WaitForSingleObject(hProcess, INFINITE);                        WaitForSingleObject(hProcess, INFINITE);
                                                                  >     DWORD exitCode;
                                                                  >     GetExitCodeProcess(hProcess, &exitCode);
        ::CloseHandle(hProcess);                                        ::CloseHandle(hProcess);
                                                                  >     return exitCode;
      }                                                               }
      return 0;                                                       return 0;
    }                                                               }
    cd C:\Tmp\7z2409\CPP\7zip\Bundles\SFXSetup
    rmdir /q /s o
    nmake
    
    copy /y O\7zS.sfx C:\Tmp\7zS-vs2010-2409-x86.sfx
    copy /y O\7zS.sfx C:\Tmp\7zSConsole-vs2010-2409-x86.sfx
    editbin.exe C:\Tmp\7zSConsole-vs2010-2409-x86.sfx /subsystem:console
    fc.exe /b C:\Tmp\7zS-vs2010-2409-x86.sfx C:\Tmp\7zSConsole-vs2010-2409-x86.sfx
    rmdir /q /s o
    exit
  • Select Start > Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio x64 Win64 Command Prompt (2010).

    REM 7z920:  Prevent: 'ml' is not recognized as an internal or external command, operable program or batch file.
    REM 7z1604: Prevent: 'ml' is not recognized as an internal or external command, operable program or batch file.
    set CPU
    set CPU=AMD64
    set CPU
    
    REM 7z1900: Prevent: 'ml' is not recognized as an internal or external command, operable program or batch file.
    REM 7z2301: Prevent: 'ml' is not recognized as an internal or external command, operable program or batch file.
    REM 7z2409: Prevent: 'ml' is not recognized as an internal or external command, operable program or batch file.
    set PLATFORM
    set PLATFORM=x64
    set PLATFORM
    
    cd C:\Tmp\7z2409\CPP\7zip\Bundles\SFXSetup
    rmdir /q /s x64
    nmake
    
    copy /y x64\7zS.sfx C:\Tmp\7zS-vs2010-2409-x64.sfx
    copy /y x64\7zS.sfx C:\Tmp\7zSConsole-vs2010-2409-x64.sfx
    editbin.exe C:\Tmp\7zSConsole-vs2010-2409-x64.sfx /subsystem:console
    fc.exe /b C:\Tmp\7zS-vs2010-2409-x64.sfx C:\Tmp\7zSConsole-vs2010-2409-x64.sfx
    rmdir /q /s x64
    exit
  • Note: 7z920: Windows XP: Delta-Windows-Tools-4.4.9Beta-x86.exe: This application has failed to start because MSVCR100.dll was not found. Re-installing the application may fix this problem.

  • Note: 7z1604: Windows XP: Delta-Windows-Tools-4.4.9Beta-x86.exe: This application has failed to start because MSVCR100.dll was not found. Re-installing the application may fix this problem.

  • Note: 7z1900: Windows XP: Delta-Windows-Tools-4.4.9Beta-x86.exe: OK.

  • Note: 7z2301: Windows XP: Delta-Windows-Tools-4.4.9Beta-x86.exe: OK.

  • Note: 7z2409: Windows XP: Delta-Windows-Tools-4.4.9Beta-x86.exe: OK.

  • Note: 7z2409: Windows 11: Delta-Windows-Tools-4.4.9Beta-x64.exe: OK.

3. Visual Studio 2013

3.1. Installation

  • Right-click W:\Software\Microsoft\Visual Studio\Visual Studio 2013\vs2013.5_ce_enu.iso and select Open with > Windows Explorer.

  • Run the vs_community.exe file with administrative privileges.

  • Check I agree to the License Terms and Privacy Policy.

  • Uncheck Join the Visual Studio Experience Improvement Program.

  • Click Next.

  • Uncheck Microsoft SQL Server Data Tools.

  • Uncheck Microsoft Web Developer Tools.

  • Uncheck Silverlight Development Kit.

  • Click INSTALL.

  • Wait for about 15 minutes for the installation to finish.

  • Close the Visual Studio window.

3.2. Usage

  • Select Start > Programs > Visual Studio 2013 > Visual Studio Tools.

  • Double-click the VS2013 x86 Native Tools Command Prompt link.

    7z920:
    Main.cpp
    ../../../Windows/NtCheck.h(13) : error C2220: warning treated as error - no 'object' file generated
    ../../../Windows/NtCheck.h(13) : warning C4996: 'GetVersionExA': was declared deprecated
            C:\Program Files (x86)\Windows Kits\8.1\include\um\sysinfoapi.h(433) : see declaration of 'GetVersionExA'
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2'
    7z2301:
    StdAfx.cpp
    c:\tmp\7z2301\cpp\7zip\bundles\sfxsetup\StdAfx.h(4) : error C2220: warning treated as error - no 'object' file generated
    c:\tmp\7z2301\cpp\7zip\bundles\sfxsetup\StdAfx.h(4) : warning C4619: #pragma warning : there is no warning number '4464'
    c:\tmp\7z2301\cpp\7zip\bundles\sfxsetup\../../UI/FileManager/StdAfx.h(7) : warning C4619: #pragma warning : there is no warning number '4464'
    c:\tmp\7z2301\cpp\7zip\ui\filemanager\../../../../C/Compiler.h(46) : warning C4619: #pragma warning : there is no warning number '4464'
    c:\tmp\7z2301\cpp\7zip\ui\filemanager\../../../Common/Common.h(4) : warning C4619: #pragma warning : there is no warning number '4464'
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2'
    7z2409:
    StdAfx.cpp
    c:\tmp\7z2409\cpp\7zip\bundles\sfxsetup\StdAfx.h(4) : error C2220: warning treated as error - no 'object' file generated
    c:\tmp\7z2409\cpp\7zip\bundles\sfxsetup\StdAfx.h(4) : warning C4619: #pragma warning : there is no warning number '4464'
    c:\tmp\7z2409\cpp\7zip\bundles\sfxsetup\../../UI/FileManager/StdAfx.h(7) : warning C4619: #pragma warning : there is no warning number '4464'
    c:\tmp\7z2409\cpp\7zip\ui\filemanager\../../../Common/Common.h(4) : warning C4619: #pragma warning : there is no warning number '4464'
    c:\tmp\7z2409\c\Compiler.h(114) : warning C4619: #pragma warning : there is no warning number '4464'
    c:\tmp\7z2409\cpp\common\Common0.h(4) : warning C4619: #pragma warning : there is no warning number '4464'
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2'
    REM https://devblogs.microsoft.com/cppblog/windows-xp-targeting-with-c-in-visual-studio-2012
    set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE%
    set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;%PATH%
    set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib;%LIB%
    set CL=/D_USING_V110_SDK71_
    set LINK=/SUBSYSTEM:CONSOLE,5.01
    7z1604:
    MSVCRT.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    O\7zS.sfx : fatal error LNK1120: 1 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.EXE"' : return code '0x460'
    7z1900:
    LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    o\7zS.sfx : fatal error LNK1120: 1 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.EXE"' : return code '0x460'
  • Select Start > Programs > Visual Studio 2013 > Visual Studio Tools.

  • Double-click the VS2013 x64 Native Tools Command Prompt link.

4. Visual Studio 2015

4.1. Installation

  • Right-click W:\Software\Microsoft\Visual Studio\Visual Studio 2015 Update 3\vs2015.3.com_enu.iso and select Open with > Windows Explorer.

  • Run the vs_community.exe file with administrative privileges.

  • Choose Custom.

  • Click Next.

  • Expand Programming Languages.

  • Expand Visual C++.

  • Check Common Tools for Visual C++ 2015.

  • Check Microsoft Foundation Classes for C++.

  • Check Windows XP Support for C++.

  • Click Next.

  • Click Install.

  • Wait for about 15 minutes for the installation to finish.

  • Note: The following failed to install: Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.24215

  • Note: The following failed to install: Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.24215

  • Close the Visual Studio window.

4.2. Usage

  • Select Start > Programs > Visual Studio 2015 > Visual Studio Tools > Windows Desktop Command Prompts > VS2015 x86 Native Tools Command Prompt.

    7z920:
    Main.cpp
    ../../../Windows/NtCheck.h(13): error C2220: warning treated as error - no 'object' file generated
    ../../../Windows/NtCheck.h(13): warning C4996: 'GetVersionExA': was declared deprecated
    C:\Program Files (x86)\Windows Kits\8.1\include\\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
    REM https://devblogs.microsoft.com/cppblog/windows-xp-targeting-with-c-in-visual-studio-2012
    set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE%
    set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;%PATH%
    set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib;%LIB%
    set CL=/D_USING_V110_SDK71_
    set LINK=/SUBSYSTEM:CONSOLE,5.01
    
    REM https://stackoverflow.com/questions/687179/how-can-i-force-msvc-to-ignore-crt-dependencies-of-a-static-library
    REM /NODEFAULTLIB:msvcrt.lib
    REM /NODEFAULTLIB:libcmt.lib
    REM /NODEFAULTLIB
    REM /Zl
    
    REM https://stackoverflow.com/questions/79324205/where-to-set-the-ld-option-when-using-the-msvc-compiler
    REM In my tests, in fact, /MT and /MD are configuration options for the runtime library settings.
    REM /MD indicates that the runtime library is provided by the operating system as a DLL and is not embedded in the program.
    REM As a result, the compiled file is smaller. The library used is MSVCRT.lib.
    REM /MT indicates that the runtime library is embedded within the program.
    REM This results in a larger compiled file. The library used is LIBCMT.lib.
    
    REM set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include
    REM set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;%PATH%
    REM set LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB;%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib
    set CFLAGS=-D_ATL_XP_TARGETING
    set CL=/D_USING_V110_SDK71_
    set LINK=/SUBSYSTEM:CONSOLE,5.01
    7z1604:
    MSVCRT.lib(exe_main.obj) : error LNK2019: unresolved external symbol _main referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
    O\7zS.sfx : fatal error LNK1120: 1 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.EXE"' : return code '0x460'
    7z1900:
    LIBCMT.lib(exe_main.obj) : error LNK2019: unresolved external symbol _main referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
    o\7zS.sfx : fatal error LNK1120: 1 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.EXE"' : return code '0x460'
    7z2301:
    LIBCMT.lib(exe_main.obj) : error LNK2019: unresolved external symbol _main referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
    o\7zS.sfx : fatal error LNK1120: 1 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.EXE"' : return code '0x460'
    7z2409:
    LIBCMT.lib(exe_main.obj) : error LNK2019: unresolved external symbol _main referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
    o\7zS.sfx : fatal error LNK1120: 1 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.EXE"' : return code '0x460'
  • Select Start > Programs > Visual Studio 2015 > Visual Studio Tools > Windows Desktop Command Prompts > VS2015 x64 Native Tools Command Prompt.

5. Visual Studio 2019

5.1. Products

All Visual Studio 2019 products are available at https://visualstudio.microsoft.com/downloads. The downloads are just bootstrappers. Each bootstrapper can be used to install a Visual Studio product online or download a local install cache for offline installation.

Product Minimal Disk Space

Build Tools

13 GB

Community

Enterprise

Professional

5.2. Visual Studio Build Tools

Several workloads and components can be installed depending on what build tools are needed.

5.2.1. Default Installation

The default installation installs the Visual Studio Installer and the MSBuild Tools.

It will install the following software. See Control Panel > Programs and Features.

  • Microsoft Visual Studio Installer

  • Visual Studio Build Tools 2019

  • Enter the following commands at a Command Prompt with administrative privileges.

    cd /d "W:\Software\Microsoft\Visual Studio\Visual Studio 2019"
    vs_BuildTools-16.10.31515.178.exe --passive
    home
    where csc
    where msbuild

5.3. Visual Studio Installer

  • Start Visual Studio Installer with administrative privileges.

  • Select the Installed tab.

  • Click Update.

  • Select the Available tab.

  • Select Visual Studio Community 2019 | Install.

  • Check .NET desktop development.

  • Click Install.

  • Click Restart.

  • Enter the following commands at a PowerShell Command Prompt with administrative privileges.

    Get-ExecutionPolicy -List
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
    Get-ExecutionPolicy -List
  • Enter the following commands at a PowerShell Command Prompt.

    Get-ExecutionPolicy -List
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    Get-ExecutionPolicy -List

5.4. Visual Studio 2019

  • Start Visual Studio 2019.

  • Select Not now, maybe later to skip signing in.

  • Select Development Settings: | General.

  • Click Start Visual Studio.

  • Close Visual Studio 2019.

5.5. Usage

  • Start Start > Programs > Visual Studio 2019 > Visual Studio tools > Developer Command Prompt for VS 2019.

  • Contents of the C:\Tmp\HelloWorld.cs file.

    using System;
    
    namespace HelloWorld
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Hello World!");
            }
        }
    }
  • Enter the following commands at a Command Prompt.

    csc.exe C:\Tmp\HelloWorld.cs -out:C:\Tmp\HelloWorld.exe
    dir C:\Tmp\HelloWorld*
    C:\Tmp\HelloWorld.exe
  • Close Start > Programs > Visual Studio 2019 > Visual Studio tools > Developer Command Prompt for VS 2019.

5.6. WSL Distro Launcher Installation

This is the minimal installation of Visual Studio Build Tools to build a WSL Distro Launcher.

Make sure to have enough disk space. About 15 GB of disk space is required. It will install the following software. See Control Panel > Programs and Features.

  • Windows Mobile Connectivity Tools 10.0.15254.0 - Desktop x86

  • Windows SDK AddON

  • Windows Software Development Kit - Windows 10.0.17134.12

  • Start Visual Studio Installer with administrative privileges.

  • Click Visual Studio Build Tools 2017 > Modify.

  • Select the Workloads tab.

  • Check Visual C++ build tools.

  • Check Universal Windows Platform build tools.

Windows
  ■ Visual C++ build tools
  ■ Universal Windows Platform build tools
  □ .NET desktop build tools
Web & Cloud
  □ Web development build tools
  □ Office/SharePoint build tools
  □ Azure development build tools
  □ Data storage and processing build tools
Mobile & Gaming
  □ Mobile Development with .NET
Uncategorized
  □ Node.js build tools
Other Toolsets
  □ .NET Core build tools
  □ Visual Studio extension development
  • Expand MSBuild Tools in the Summary panel.

  • Expand Visual C++ build tools in the Summary panel.

  • Expand Universal Windows Platform build Tools in the Summary panel.

  • Uncheck Visual C++ build tools > Optional > Testing tools core features - Build Tools.

Summary
MSBuild Tools
  Provides the tools required to build MSBuild-based applications.
Visual C++ build tools
  Included
  ■ Visual C++ Build Tools core features
  ■ VC++ 2017 version 15.7 v14.14 latest v141 tools
  ■ Visual C++ 2017 Redistributable Update
  Optional
  ■ Windows 10 SDK (10.0.17134.0)
  □ Testing tools core features - Build Tools
  □ Windows 8.1 SDK and UCRT SDK
  □ Visual C++ ATL for x86 and x64
  □ Visual C++ MFC for x86 and x64
  □ C++/CLI support
  □ Modules for Standard Library (experimental)
  □ Windows 10 SDK (10.0.16299.0) for Desktop C++ [x86 and x64]
  □ Windows 10 SDK (10.0.15063.0) for Desktop C++ [x86 and x64]
  □ Windows 10 SDK (10.0.14393.0)
  □ Windows 10 SDK (10.0.10586.0)
  □ Windows 10 SDK (10.0.10240.0)
  □ VC++ 2015.3 v14.00 (v140) toolset for desktop
  ■ Visual C++ compilers and libraries for ARM
  □ Visual C++ compilers and libraries for ARM64
  □ Windows XP support for C++
Universal Windows Platform build tools
  Included
  ■ Universal Windows Platform build prerequisites
  Optional
  ■ Windows 10 SDK (10.0.17134.0)
  □ Windows 10 SDK (10.0.16299.0) for UWP: C#, VB, JS
  □ Windows 10 SDK (10.0.15063.0) for UWP: C#, VB, JS
  □ Windows 10 SDK (10.0.14393.0)
  □ Windows 10 SDK (10.0.10586.0)
  □ Windows 10 SDK (10.0.10240.0)
Total space required    13.43 GB
  • Click Modify.

  • Wait about 30 minutes for the downloads nad installations to finish.

  • Click Not now to skip restarting the computer.

  • Close Visual Studio Installer.

  • Restart the computer.

6. Visual Studio 2022

6.1. Installation

7. Visual Studio Build Tools 2022

7.1. Installation

  • Download Build Tools for Visual Studio 2022 from https://visualstudio.microsoft.com/downloads/#other.

  • Run the W:\Software\Microsoft\Visual Studio\Visual Studio 2022\vs_BuildTools-17.14.36202.13.exe file with administrative privileges.

  • Click Continue.

  • Wait for Visual Studio Installer download and installation to finish.

  • Check Desktop development with C++.

  • Click Install.

  • Wait for Visual Studio Build Tools 2022 download and installation to finish.

  • Click OK.

  • Close Visual Studio Installer.