IntelliSense: Cannot open source file in include path

你离开我真会死。 提交于 2019-12-12 03:26:21

问题


I am authoring a C++ project with Visual Studio 2013 Professional and I encountered a problem I have never encountered before.

In one of my source files I am including a third-party header file like this:

#include 'sqlcli1.h'

This file (and other files of the same set) are located in a an external directory (not in the VS solution), so I have added it to the search path using Additional include paths under project's Properties.

The solution does build succesfuuly, so I am sure my external header file is referenced correctly. IntelliSense, however, still doesn't see it and complains about not being able to open source file 'sqlcli1.h'. It does not prevent me from building the project, but it makes editing it much harder.

Why does this happen and what should I do?


回答1:


Have you tried to delete the IntelliSense file in your solution directory? It may be as large as a few hundred MBs, along with the "ipch" directory. VS will rebuild the IntelliSense file and it may help solve your problem.




回答2:


Alas, I did everything above but, to no avail. For me the problem is the *.vcxproj file. I took the contents of a working *.vcxproj file and replaced it with the one that didn't work (changing the project name in the *.vcxproj file, of course!!) And, Wowie Zowie!! It works! There is probably a much more elegant solution, but this worked for me. Also, my problem was related to a C1083 error, too.



来源:https://stackoverflow.com/questions/36466938/intellisense-cannot-open-source-file-in-include-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!