在 Visual Studio 2017 上使用 VC++ 2015 工具链时缺少 ATL headers
ATL headers missing when using the VC++ 2015 toolchain on Visual Studio 2017
我正在为 C++ 项目(使用 VS 2015 创建)使用 Visual Studio 2017。我收到以下错误:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\afx.h(345): fatal error C1083: Cannot open include file: 'atltrace.h': No such file or directory
如何安装 VS 2015 工具链的 ATL/MFC header?
详情
- "Platform Toolset" 设置(在 "Project properties/General/Platform Toolset")
- 设置为“Visual Studio 2015 (v140),
- 将平台工具集更改为“Visual Studio 2017 (v141) 编译正常。
- 光盘上的文件
- VS 2015 (
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\
) 的包含目录包含 afx*.h
个文件,但 没有 atl*.h
个文件。
- 这些丢失的文件似乎属于
VC_ATL.Headers.msi
("Visual C++ Library ATL Headers Package")(我在另一台机器上检查过这些文件)。我无法安装相应的 msi。 (我从另一台机器上拿了 msi。)错误:"To install this product, please run Setup.exe. [...]".
- VS 2017 (
C:\Program Files (x86)\Microsoft Visual Studio17\Professional\VC\Tools\MSVC.11.25503\atlmfc\include\
) 的相应目录确实包含 这些文件。
- 安装程序
- "Windows Desktop Development with C++/VC++ 2015.3 v140 toolset for desktop (x86,x64)" 已勾选。
- 在我看来,v140 工具集缺少 ATL/MFC headers.
- "Windows Desktop Development with C++/MFC and ATL support(x86 and x64)"好像不太相关,好像是关于VS 2017版本的。
- VC++ 可再分发似乎无关紧要,因为它们不包含 header 文件。
有一个关于 Visual C++ Build Tools 2015 的 blog post。构建工具也以独立版本发布,无需安装 Visual Studio 2015:
The Build Tools are the same C++ tools that you get with Visual Studio 2015 but they come in a scriptable standalone installer that only lays down the tools you need to build C++ projects.
Microsoft 已包含 ATL/MFC。
它们可以从 http://landinghub.visualstudio.com/visual-cpp-build-tools 下载。确保 select "ATL and MFC" 默认情况下已取消 select。
我正在为 C++ 项目(使用 VS 2015 创建)使用 Visual Studio 2017。我收到以下错误:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\afx.h(345): fatal error C1083: Cannot open include file: 'atltrace.h': No such file or directory
如何安装 VS 2015 工具链的 ATL/MFC header?
详情
- "Platform Toolset" 设置(在 "Project properties/General/Platform Toolset")
- 设置为“Visual Studio 2015 (v140),
- 将平台工具集更改为“Visual Studio 2017 (v141) 编译正常。
- 光盘上的文件
- VS 2015 (
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\
) 的包含目录包含afx*.h
个文件,但 没有atl*.h
个文件。 - 这些丢失的文件似乎属于
VC_ATL.Headers.msi
("Visual C++ Library ATL Headers Package")(我在另一台机器上检查过这些文件)。我无法安装相应的 msi。 (我从另一台机器上拿了 msi。)错误:"To install this product, please run Setup.exe. [...]". - VS 2017 (
C:\Program Files (x86)\Microsoft Visual Studio17\Professional\VC\Tools\MSVC.11.25503\atlmfc\include\
) 的相应目录确实包含 这些文件。
- VS 2015 (
- 安装程序
- "Windows Desktop Development with C++/VC++ 2015.3 v140 toolset for desktop (x86,x64)" 已勾选。
- 在我看来,v140 工具集缺少 ATL/MFC headers.
- "Windows Desktop Development with C++/MFC and ATL support(x86 and x64)"好像不太相关,好像是关于VS 2017版本的。
- VC++ 可再分发似乎无关紧要,因为它们不包含 header 文件。
有一个关于 Visual C++ Build Tools 2015 的 blog post。构建工具也以独立版本发布,无需安装 Visual Studio 2015:
The Build Tools are the same C++ tools that you get with Visual Studio 2015 but they come in a scriptable standalone installer that only lays down the tools you need to build C++ projects.
Microsoft 已包含 ATL/MFC。
它们可以从 http://landinghub.visualstudio.com/visual-cpp-build-tools 下载。确保 select "ATL and MFC" 默认情况下已取消 select。