"Cannot Open Include File" MS Visual C++ compiler error

Discussion in 'C++' started by analeah, Sep 1, 2006.

  1. analeah

    analeah New Member

    Joined:
    Sep 1, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I just installed the latest version of Visual C++ from Microsoft on a windows XP system. I have used this program before, but this time, on my new install, when I try to compile, I'm getting an error, "c:\documents and settings\user\desktop\r\listdbl.cpp(1) : fatal error C1083: Cannot open include file: 'listdbl.h': No such file or directory"

    What I'm trying to do:
    I have a project I'm working on that has a header file "listdbl.h" and two source files that call it, "listdbl.cpp" and a driver. All files are in the same directory:
    "c:\documents and settings\user\desktop\r". To start, I opened a new project and added these files. When I tried to compile "listdbl.cpp" I got that error.

    What I have tried:
    I have tried following the help file on "additional include directories" thinking that this is my problem (and it still may be). For the line to include a file the help says:

    "The following command looks for the include files requested by MAIN.c in the following order: first in the directory containing MAIN.c, then in the \INCLUDE directory, then in the \MY\INCLUDE directory, and finally in the directories assigned to the INCLUDE environment variable.

    Copy Code
    CL /I \INCLUDE /I\MY\INCLUDE MAIN.C"

    I tried, "CL /I \INCLUDE /I\C:\Documents and Settings\User\Desktop\Include"

    And I'm still getting the same error. Any ideas? Any help is greatly appreciated!

    Thank you,
    -Leia Chancellor

     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,376
    Likes Received:
    388
    Trophy Points:
    83
    Try adding the .h file into the FileView of the workspace.
     
  3. Aztec

    Aztec New Member

    Joined:
    May 9, 2006
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    0
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,376
    Likes Received:
    388
    Trophy Points:
    83
    #include "headerfile.h" does not work in MS VC if you have the file in the folder and not included in the work space in any of the folder including the external dependencies. By default in some case it includes the file in the external dependencies area if not present in the other folders.

    I would say a probable bug in the IDE.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice