qt5.14.2 Independent msvc environment construction (without installing vs)

In general, for qt development under msvc, whether you use qtcreator or vs, it is recommended to install the corresponding vs version, which is the most trouble-free and convenient, but in some cases it is inconvenient to install vs but the project needs to use msvc, you can just install it msvc c++ compiler, the steps are as follows:

Remarks: All the packages used in this article are uploaded to the unlimited speed Ali cloud disk, welcome to pay attention to Alibaba cloud disk sharing https://www.aliyundrive.com/ s/xRnxGiTznH1

1. Install qt5.14.2 first (if you disconnect from the external network, you do not need to log in);

2. Generally, it is installed on the D drive, only change C to D (please change C:\Qt\Qt5.14.2a to D:\Qt\Qt5.14.2a), do not change the directory structure.

3. Check the corresponding component in the green box;

4. Select lgpl

5. At this time, qtcraeator, option, inside the kit reports a yellow warning, because the C and C++ compiler below cannot find it. Now start to install msvc.

6. Install the msvc C ++ generation tool (compiler) and windows sdk, as shown in the figure below;

Microsoft also clearly stated in the document that if you want to install only C ++ development tools, you can choose “visual c ++ build tools”.

Popularity: McroSoftVisual C++ throughout msvc.

visual C + + generation tool: contains all compilation link tool chains and most function libraries and header files;

Windows 10 SDK: Provide some other necessary library files and header files, the most important thing is that the cdb debugger is here (similar to linux gdb);

Independently install the official website of Microsoft visual c + + build tools, and download the corresponding version of vs_BuildTools.exe from the following website; Microsoft C + + build tools – Visual Studio icon-default.png?t= N2N8https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/

The Microsoft C++ Build Tools provide the MSVC toolset through a scriptable stand-alone installer without the need for Visual Studio. This tool is recommended if building C++ libraries and applications targeting Windows from a command-line interface (for example, in a continuous integration workflow). Includes tools from Visual Studio 2015 Update 3, Visual Studio 2017, Visual Studio 2019, and the latest version, Visual Studio 2022.

7.1 Install the visual C ++ generation tool online, as shown in the figure below, check it and click Install;

7.2 Offline mode:

7.2.1 First download the package required by the visual C ++ generation tool offline, the command is as follows:

vs_buildtools.exe --layout C:\vsBuild2017 --lang zh-CN -add Microsoft.VisualStudio.Workload.VCTools

7.2.3 Copy the offline package to a computer that cannot be connected to the Internet, then open vs_BuildTools.exe, and click install directly in the lower right corner

Please remember the first optional item, the version of windows10SDK, the picture below is 10.0.17763

8.1 Download and install windows10 sdk. The version of windows10 sdk must also correspond to the version of vs_BuildTools.exe. In 7.2.3, we already know that the version is windows10SDK 10.0.17763 Windows Development Kit – Windows Application Development|Microsoft Developer (microsoft.com)< img class="link-link-icon" src="//i2.wp.com/csdnimg.cn/release/blog_editor_html/release2.2.4/ckeditor/plugins/CsdnLink/icons/icon-default.png? t=N2N8" alt="icon-default.png?t=N2N8">https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ as shown below:

8.2 Unzip and install the iso;

8.3 select install

8.4 It is recommended to select all here, the arm architecture at the bottom is not used and can be canceled.

8.5 The installation is complete;

9.1. Restart qtcreator, as shown in the figure below:

9.2 Set up c, c++ and debugger;

10. Test