I just added an entire folder of existing source, using the "Add existing files" dialog. Everything in that folder/filter builds, EXCEPT for one particular file. I can open the file through the solution explorer and view it--the IDE knows the file is there. When I try to build, however, I get this error (I slightly modified the filenames and paths just to be safe with respect to my employers disclosure policies):
1>XXX_Presentation_Activity.cpp 1>c1xx : fatal error C1083: Cannot open source file: '..\..\PresentationActivity\XXX_Presentation_Activity\XXX_Presentation_Activity.cpp': No such file or directory
The problem occurs in each of a series of similar folders/filters... everything builds, except for the file with the similar name:
1>YYY_Presentation_Activity.cpp 1>c1xx : fatal error C1083: Cannot open source file: '..\..\PresentationActivity\YYY_Presentation_Activity\YYY_Presentation_Activity.cpp': No such file or directory 1>ZZZ_Presentation_Activity.cpp 1>c1xx : fatal error C1083: Cannot open source file: '..\..\PresentationActivity\ZZZ_Presentation_Activity\ZZZ_Presentation_Activity.cpp': No such file or directory
Again... each of these files is present in solution explorer, and can be opened and edited. The files are there.
OK... it has something to do with the length of the filename... if the source filename is longer than 30 characters, it doesn't build. Is this by design?
Earlier, I shortened the filenames... in reality, the source file I'm trying to build is more along the lines of: FOO_BAR_Presentation_Activity.cpp
It will build if I shorten that to: FOO_BAR_Presentation_Activ.cpp
Well, I guess the path length was too long, but only on those files, which made it appear to be something more bizarre than it was. If the full path to the file exceeded 210 characters, it gave a compile error. (That seems like an arbitrary length.)
It is not as arbitrary as you think. Look at the _MAX_PATH and _MAX_DIR symbolic names (macros or whatever). If you search the headers then you can see what their actual values are; that might explain what is happening. If so, then probably the VS documentation explains what to do; perhaps you need to use UNC names.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.