VS2017 c++关于#include 头文件错误问题

VS2017 c++关于#include 头文件错误问题

新安装的vs2017 c++桌面开发环境 
在编译控制台程序中 添加mfc支持时报 afx.h文件找不到。

参考:afxwin.h not found by VS2017

Reported by Paul Nelson 2016年11月16日 21:22 Closed - Not a Bug windows 10.0visual studio 2017 rc 
I have installed VS2017 with the C++ development tools, and then installed the MFC/ATL support tools. Running the VS2017 installer app shows them all installed. I also installed the Windows 10 SDK I then took a MFC app previously developed using VS2010, opened it with VS2017, retargeted it to the new compiler and retargeted it to the new SDK. However, when I try to rebuild it, it fails because it can't find afxwin.h 
隐藏 10 
Daniel Griffing · 2016年11月16日 21:54 0 
Hello Paul, 
I'm sorry you're running into issues with upgrading this project to Visual Studio 2017 RC. Could you check whether you're seeing afxwin.h installed under the following location? (Please note the following assumes Enterprise on an x64 Windows machine) 
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.24629\atlmfc\include\afxwin.h" 
If the file is not there, could you double check whether the "ATL and MFC" optional feature in the Visual C++ Desktop workload is selected (I assume it will be based upon your problem description)? 
Please let me know either way and we can dig further. The next step in the investigation will depend on the answer to whether it was installed at all. 
Regards, 
–Daniel Griffing, Visual C++ Libraries 
来源: https://developercommunity.visualstudio.com/content/problem/2456/afxwinh-not-found-by-vs2017.html

解决方式:

手动添加安装 VS "MFC和ATL支持(x86和x64)"支持库

重启vs编译成功

你可能感兴趣的:(VS2017 c++关于#include 头文件错误问题)