简体   繁体   中英

How to use subfolders of the VC++ Include Directories in Visual Studio 2017

I have a given solution, not written by me, from Visual Studio 2015 in C++ with a rather complex structure and many source files.

The solution uses some header files from an outside application, that are organized in one folder containing 268 subfolders , containing other folders and/or header files.

An illustration of the header files folder structure:

头文件文件夹结构图

In other words the outside application has a tree structure of header files to be used when developing custom code for it.

I am using Visual Studio 2017 and I know that in order to use a header file like #include <hfile.h> I need to specify its location in Configuration Properties -> VC++ Directories -> Include Directories . The problem is that subfolders of this entry are not scanned and I have 268 subfolders and a big project where I cannot edit all includes.

I think there should be a better way to reference all header files used in the project. Can someone help me in this situation? Thanks!

Visual Studio cannot be configured to look recursively into subdirectories of directories on the include path ( ref ).

That way absolute madness would lie as the potential for conflicts would skyrocket, and the time to resolve includes would also go up.

I'm sorry that you have so many subfolders, but the solution is to fix that. That's an insane project layout. Getting rid of all those "copies" would be a good start…

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM