none
"No such file or directory", but the file exists.

    Question


  • My problem, in a nutshell...

    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.

    Any idea what might be causing these?

    Tuesday, January 08, 2008 5:41 PM

Answers

  • 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.)

    Tuesday, January 08, 2008 7:50 PM

All replies

  • 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

    But nothing longer.


    Tuesday, January 08, 2008 6:18 PM
  • 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.)

    Tuesday, January 08, 2008 7:50 PM
  • 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.

     

    Tuesday, January 08, 2008 10:24 PM