使用VC ++应该是一个简单的问题,并且无法访问默认包含项,这使我大吃一惊.
Pulling out my hair on what should be a simple issue with using VC++ and being unable to access the default includes.
在安装Visual Studio 2015 RC之后,我无法再构建C/C ++项目.对于所有各种标准库* .h文件,我收到"IntelliSense:无法打开源文件'* .h'"错误.
After installing Visual Studio 2015 RC, I can no longer build C/C++ projects. I receive "IntelliSense: cannot open source file '*.h'" errors for all the various standard library *.h files.
我确认我的文件确实存在于默认位置(C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ include),并且如果我在编辑器中右键单击我的#include <cstdio>行,可以选择打开文档",它甚至可以在编辑器中自动打开.
I confirmed that my files do exist in the default locations (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include), and if I right-click on my #include <cstdio> line in the editor I can choose "Open Document" and it even opens automatically in the editor.
项目设置"中的我的包含目录"字符串是:
My Include Directories string in the Project Settings is:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Users\Kristopher\Libraries\Includes;$(VC_IncludePath);$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);还有其他人遇到吗?我觉得自己正在忽略一些简单的事情.
Has anyone else run into this? I feel like I'm overlooking something simple.
推荐答案您的IncludePath不应直接指定Visual C ++和Windows SDK包含路径.相反,它应该仅指定特定于您的项目的路径,并从通用C ++ MSBuild目标中定义的IncludePath派生.例如,
Your IncludePath should not specify the Visual C++ and Windows SDK include paths directly. Instead, it should specify only the paths specific to your project and derive from the IncludePath defined in the common C++ MSBuild targets. E.g.,
<IncludePath>C:\Users\Kristopher\Libraries\Includes;$(IncludePath)</IncludePath>要解决您的特殊情况:在Visual C ++ 2015中,大部分C运行时(CRT)已重构为新的Windows操作系统组件Universal CRT.现在它的标头和库位于其他位置,您的项目无法将此包含路径包含到IncludePath属性中.具体来说,您需要包括$(UniversalCRT_IncludePath).有关更多详细信息,请参阅我今年早些时候写的文章通用CRT简介."
To address your particular case: In Visual C++ 2015, the bulk of the C Runtime (CRT) has been refactored into a new Windows operating system component, the Universal CRT. Its headers and libraries are now in a different location and your project fails to include this include path into the IncludePath property. Specifically, you need to include $(UniversalCRT_IncludePath). For more details, see the article I wrote earlier this year, "Introducing the Universal CRT."
更多推荐
VisualStudio 2015 RC问题,包括
发布评论