Intellisense cannot open source file “*.h”

2019-01-26 09:29发布

I have no idea as to what may have happened. I was removing a few libraries I added to the VC folder and from Additional Dependencies (OpenGL libraries I've added), then when I tried to compile my program, I received 100 errors. The problem is that my current project is not recognizing some of the standard headers. Here is what I've got:

#include <Windows.h>    <-----Error from title
#include <stdio.h>      <-----Error from title
#include <stdlib.h>     <-----Error from title
#include "stdafx.h"     <-----OK
#include <CommCtrl.h>   <-----Error from title

I've created a new project to compare it's properties, but didn't notice anything missing. Does anyone have an idea as to why project isn't using these headers?

2条回答
霸刀☆藐视天下
2楼-- · 2019-01-26 09:44

Just an update on previous answer, in VS2015, the previous method of including directories has been deprecated. Its now done on a per-solution basis. In the solution explorer right click your Project Name, then select properties, the dialog that opens up is similar to older VS. Add the paths as suggested above to the include directories and away you go.

查看更多
放我归山
3楼-- · 2019-01-26 10:02

Make sure you have all these paths under VC++ directories->Include Directories:

$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);‌​

查看更多
登录 后发表回答