Qt Creator IDE和MSVC 2015编译器组合使用(不想完整安装VS2015)

简介: Qt Creator IDE和MSVC 2015编译器组合使用(不想完整安装VS2015)

出发点是不想完整安装VS2015,只想安装C++编译器,然后提供给Qt Creator使用。


也就是说Windows下开发应用或库时,如果不想安装完整的Visual Studio,可以选择只安装Visual C++ Build Tools即可。


The Microsoft Visual C++ Build Tools installs only the command-line compiler, tools, and libraries you need to build C and C++ programs. It's perfect for build labs or classroom exercises and installs relatively quickly. To install only the command-line tools, download and install  Microsoft Visual C++ Build Tools 2015 .

The following tools can help you to build a C/C++ project on the command line.

1. CL

Use the compiler (cl.exe) to compile and link source code files into apps, libraries, and DLLs.

2. Link

Use the linker (link.exe) to link compiled object files and libraries into apps and DLLs.

3. MSBuild (Visual C++)

Use MSBuild (msbuild.exe) to build Visual C++ projects and Visual Studio solutions. This is equivalent to running the Build project or Build Solution command in the Visual Studio IDE.

4. DEVENV

Use DEVENV (devenv.exe) combined with a command-line switch—for example, /Build or /Clean—to perform certain build commands without displaying the Visual Studio IDE.

5. NMAKE

Use NMAKE (nmake.exe) to automate tasks that build Visual C++ projects by using a traditional makefile.

第一:在链接 https://visualstudio.microsoft.com/zh-hans/vs/older-downloads/,找到了可再发行组件和生成工具:

Microsoft Visual C++ 2015 Redistributable 更新 3

Microsoft 生成工具 2015 更新 3

我们顺序安装。需要注意的一点是,在安装VS2015的生成工具的时候,请选择默认安装,默认的是winSDK 8.1。


visualcppbuildtools_full.exe默认是在线安装,我们也可以设置成离线安装:


visualcppbuildtools_full.exe /layout d:\vs2015


第二,安装用于程序调试的WinDbg调试器,微软官方把WinDbg调试器隐含到Windows SDK 8.1中了,所以要安装Windows SDK。

下载链接: https://developer.microsoft.com/en-us/windows/downloads/sdk-archive选择Windows 8.1版本安装,注意只需要装Debugging Tools for Windows。

firecat注:我是全部完整地安装了Windows SDK 8.1。


VS调试时,只使用自己带的调试器,不会使用WinDbg。WinDbg安装目录包含有CDB。CDB可以提供给Qt Creator调用。


第三,安装QT(也要注意下载MSVC2015版本的QT)选择32位和64位的版本之后默认安装即可。


第四:安装完成后系统会自动检测到QT versions,Compilers,Debuggers等,然后在Qt Creator配置好kit。

image.png



第五:网上下载ucrtbased.dll库文件


把32位的ucrtbased.dll拷贝到C:\Windows\SysWOW64目录

把64位的ucrtbased.dll拷贝到C:\Windows\System32目录


第六:源码编码格式


注意: Qt Creator -> Options -> Text Editor -> Behavior -> File Encodings 更改设置为 "UTF-8",BOM设置为"Add If Encoding Is UTF-8",这样才能正确识别中文。总之VC++编译器只能识别ANSI和UTF-8+BOM这两种编码。不识别UTF-8。



---


友情链接,我的另一篇博客:


CDB调试器使用技巧与心得,重点是Symbols Path设置

相关文章
|
2月前
|
IDE 编译器 开发工具
C/C++ IDE环境 (Qt Creator visual studio等) Cmake工程不显示头文件的解决方案
C/C++ IDE环境 (Qt Creator visual studio等) Cmake工程不显示头文件的解决方案
34 0
|
1天前
|
IDE Java Shell
02|手把手教你安装JDK与配置主流IDE
02|手把手教你安装JDK与配置主流IDE
6 0
|
18天前
|
人工智能 Ubuntu Shell
【Ubuntu工具】安装教程:Ubuntu系统上源码编译安装QT5.15.13(有坑)
【Ubuntu工具】安装教程:Ubuntu系统上源码编译安装QT5.15.13(有坑)
43 0
|
18天前
|
人工智能 Ubuntu C语言
【Ubuntu工具】详细图文教程:Ubuntu系统上安装QT6.2
【Ubuntu工具】详细图文教程:Ubuntu系统上安装QT6.2
34 0
|
25天前
|
数据可视化 开发工具 C++
Qt Creator 界面
Qt Creator 界面
|
25天前
|
数据可视化 NoSQL 编译器
Qt Creator 新建项目
Qt Creator 新建项目
|
25天前
|
Windows
解决windows下Qt Creator显示界面过大的问题
解决windows下Qt Creator显示界面过大的问题
|
1月前
|
编译器 C语言
Qt使用MSVC编译错误: LNK2019: 无法解析的外部符号
Qt使用MSVC编译错误: LNK2019: 无法解析的外部符号
19 1
|
1月前
|
编译器
正点原子IMX6ULL-安装交叉编译器、编译tslib触摸屏库、编译arm环境qt源代码
正点原子IMX6ULL-安装交叉编译器、编译tslib触摸屏库、编译arm环境qt源代码
|
2月前
|
XML 网络安全 数据库
【Qt 安装】安装Qt源码所需的前置库
【Qt 安装】安装Qt源码所需的前置库
20 0

推荐镜像

更多