How to install Microsoft Visual C++ Build Tools, the fast way

How to install Microsoft Visual C++ Build Tools, the fast way

How to Install Microsoft Visual Studio C++ Build Tools via Command Line

Introduction to the Installation Process

  • The speaker introduces a simpler method for installing Microsoft Visual Studio C++ build tools using a command line instead of a graphical interface.
  • This approach is faster, more convenient, and easier to share or automate through scripting.

Scenario for Using Build Tools

  • The example provided involves compiling a Python program that uses a module written in Cython, which requires build tools on Windows.
  • Without the build tools installed, attempting to run the setup will result in an error message directing users to obtain the necessary components.

Command Line Installation Steps

  • The installation requires having the Microsoft Winget package manager installed, which comes by default with Windows 11.
  • A specific command is used to install Visual Studio 2022 build tools; this version is essential for current Python versions.

Key Command Options Explained

  • The --force switch minimizes user interaction during installation, while --override changes arguments passed to the installer.
  • The --wait option ensures that the command waits until all processes are complete before returning control to the user.
  • The --passive switch allows installation without user input, making it suitable for automation scripts.

Additional Components and Resources

  • The --add switch enables adding necessary components automatically; this includes workloads like Windows SDK required for proper compilation.
  • Microsoft provides documentation on various components available for automatic installation through Winget.

Conclusion of Installation Process

  • After running the command successfully, restarting Visual Studio Code confirms that there are no issues with missing compilers or setup errors.
Video description

If you've ever needed to compile something from C/C++ source in Microsoft Windows, odds are you've also been aggravated by how complex it can be to set up the Visual Studio C++ Build Tools. Turns out there's a simple, one-command way to do it using the Winget package manager, with minimal babysitting and fuss. Watch this video to learn how to install the Build Tools from the command line, and how to customize the setup to include more than the basic components if needed. ------------------------------­---- SUBSCRIBE: http://www.youtube.com/subscription_center?add_user=InfoWorld FACEBOOK: https://www.facebook.com/Infoworld/ TWITTER: https://twitter.com/Infoworld WEBSITE: http://www.infoworld.com/