How to add an hierarchy of Include Directories to a C project in MSVC?

烂漫一生 提交于 2019-12-12 00:05:01

问题


I am trying to maintain an ARM command line (makefile) project using the MSVS 2013 Express IDE, to take advantage of the IDE's advanced code analysis capabilities.

The project consists of dozens of directories, each including a "src" and an "include" directories. In order for Intellisense to "understand" the various tokens, I need to add all those "include" directories to the Additional Include Directories search path.

Is there a way to recursively add all folders of a project's filesystem to the path?


回答1:


If all you want is decent IntelliSense support and don't actually need the projects to build, then you can add the directories to your project as <ClInclude/> items that contain wildcards, e.g.

<ClInclude Include="path\to\root\*\include\*.h" />

You can add as many of these as you'd like and match whatever patterns you need using *. You'll need to add these to the project file manually (using a text editor); the IDE doesn't fully support items that contain wildcards.



来源:https://stackoverflow.com/questions/31060257/how-to-add-an-hierarchy-of-include-directories-to-a-c-project-in-msvc

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