问题描述:

My application contains multiple sub folders, that can go quite deep, e.g.

library\management\security\descriptor\configurations

(this is just a fictive example)

If another part of my application needs an include file of this folder it writes this:

#include "library\management\security\descriptor\configurations\config.h"

The problem is that if the file that contains this include is also in a quite deep path, like this:

people\groups\interestgroups\manager.cpp

And we have checked out our project in the folder:

E:\jenkins\workspace\application\release\flavour

Then the Visual Studio compiler (we compile using the /I. (slash-I-dot) option) first looks for the file in this location:

E:\jenkins\workspace\application\release\flavour\people\groups\interestgroups\library\management\security\descriptor\configurations\config.h"

And then only in

E:\jenkins\workspace\application\release\flavour\library\management\security\descriptor\configurations\config.h"

(this behavior is described in http://msdn.microsoft.com/en-us/library/vstudio/36k2cdd4(v=vs.100).aspx).

So it insists in looking first in the place where the compiled file is, and then only looking at the /I option.

The problem is that the place where the compiler looks first results in a filename that is too long (>256 characters) and the compiler just gives up.

Is there a way to tell Visual Studio to not stop when an include path is too long? Preferably without using the bracket include format (#include <>).

网友答案:

You can just make file in interestgroups folder that only include config.h file and you just include interestgroups file and use that file

相关阅读:
Top