Include path lenght limit below 260?

Started by
8 comments, last by Kiroke 20 years, 6 months ago
Hi, I had a weird problem with #include. I made a test project and found something really strange... The problem is that even though my additional include path & my include path is correct, the compiler won''t find it if the two path combined are too long (but still under 260 characters). Try to do it at home, it just won''t work for no obvious reasons. The project is under C:\VSProjects\testMaxPathInclude\123456789\1234567 89\123456789\Base\123456789\123456789\123456789\12 3456789\123456789\123456789\123456789\project\test MaxPathInclude. The additional include path is "..\..\..\..\..\..\..\..\..\987654321\987654321\987654321\987654321\" The include file is at C:\VSProjects\testMaxPathInclude\123456789\1234567 89\123456789\Base\987654321\987654321\987654321\98 7654321\987654321\987654321\987654321\987654321\fo o.h (this is 153 characters, way under the windows max 260) The #include is: #include "987654321\987654321\987654321\987654321\foo.h" Now, EVERY PATH IS CORRECT. You just have to create that much directories in order to make it happen, but VS won''t find the include file. If you put the include file two directories below, the program compiles. If you try to make another project NOT using relative path (\..\), you can include a file with a 260 character path. But when you try include with a long relative path, plus a long include path, VS is not able to find the file. I really need that much folders Has someone encountered that problem and found a solution OR the exact problem? Thanks alot! Kiroke
Kirokewww.geocities.com/kiroke2
Advertisement
Yeah.... that''s just silly


"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
Do you know a way I could bypass this?
Kirokewww.geocities.com/kiroke2
with a less ridiculous directory structure?
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Your not supposed to have paths that are longer than 260 characters in Windows anyways, if I remember right.


VSEDebug Visual Studio.NET Add-In. Enhances debugging in ways never thought possible.
VSEDebug Visual Studio.NET Add-In. Enhances debugging in ways never thought possible.
Yeah I know about the path being shorter than 260, but the path is actually something like 150 character long.

And I really need that architecture here at my job (trying to implement a new one)

Oh the other thing is that it works fine in debug (it includes the file) but not in release.

Thanks,
Kiroke
Kirokewww.geocities.com/kiroke2
I would also suggest giving your directories more meaningful names.
[ PGD - The Home of Pascal Game Development! ] [ Help GameDev.net fight cancer ]
Yeah this is just a test i''ve made. The real deal has significant names
Kirokewww.geocities.com/kiroke2
you should be able to specify shortcuts or default directories for a compiler (as a command line or in the IDE settings, VC6->tools->options->directories), like for the standard include directory paths, and in the #include"", you only need to specify the sub-path from the default directories. I don''t know if this still brakes the 150 character limit or not, but I never tried really

Everything is better with Metal.

Unfortunately this project is to be used by alot of others, and this solution would require different default paths. Thanks for the suggestion though.

If anyone is curious to try this bug, just download a sample project I created: www.geocities.com/kiroke2/IncludeProb.zip

The vcproj is contained in the 123456789 directories, and the include file is in the 987654321 directories.
Kirokewww.geocities.com/kiroke2

This topic is closed to new replies.

Advertisement