fatal error C1083: Cannot open include file:

This is a discussion on fatal error C1083: Cannot open include file: within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I am running about 27 projects successfully in Visual Studio 2003. When I try to do add a new ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    10

    fatal error C1083: Cannot open include file:

    Hi,

    I am running about 27 projects successfully in Visual Studio 2003.
    When I try to do add a new project having the same header files(with same Location) and Project Properties, it gives an error <fatal error C1083: Cannot open include file:>.

    i.e. if xyz.h is header file for another working projects then it should also work for new project, isn't it ?

    I need to use Visual Studio 2003 Only.

    Thanks & Regards,
    -Yogesh.

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,413
    #include "xyz.h" will only look in the current directory for the header file.
    #include <xyz.h> will look inside include paths for the file.
    If the file is in another project, chances are it's not in the same directory, so you need to specify a more specialized path such as #include "..\my_other_project\xyz.h".
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    #include "xyz.h" will only look in the current directory for the header file.
    #include <xyz.h> will look inside include paths for the file.
    If the file is in another project, chances are it's not in the same directory, so you need to specify a more specialized path such as #include "..\my_other_project\xyz.h".
    I don't think that's true. "xyz.h" will FIRST look in the current directory, then in the include-path. <xyz.h> will ONLY look in your include path, not in the current directory.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    10
    Hi,

    I do have relative path for header files and mentioned it in the Additional Dependencies in project properties properly.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by bodhankaryogesh View Post
    Hi,

    I do have relative path for header files and mentioned it in the Additional Dependencies in project properties properly.
    If the project can't find the file, then it's obviously not where the system is searching for it. I can assure you that the compiler is capable of finding the file, as long you specify the path correctly.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,413
    Well, the names of the files makes no difference. So long as you specify the correct path, it should work. If it can't open the file, then... make sure the path is correct. Try using an absolute path. Make sure you have proper file permissions.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User
    Join Date
    Mar 2008
    Posts
    10
    Hi ELysia,

    I make sure that the path is correctly given and also tried with absolute path.

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Are there spaces in your pathname?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #9
    Registered User
    Join Date
    Mar 2008
    Posts
    10
    And if it is searching the same for another project then why not for mine one ?

  10. #10
    Registered User
    Join Date
    Mar 2008
    Posts
    10
    No there are no spaces.
    Here is the example of working project "..\..\..\plugin\common\map\rvp;..\..\..\tools\Dco mpNtfs"
    The same i copied into my new project (Also tried with typing the same path and with Absolute path)

  11. #11
    Registered User
    Join Date
    Mar 2008
    Posts
    10
    Just ignore the previous path
    Actually the path is "..\..\..\plugin\common\map\rvp;..\..\..\tools\Dco mpNtfs"

  12. #12
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by bodhankaryogesh View Post
    No there are no spaces.
    Here is the example of working project "..\..\..\plugin\common\map\rvp;..\..\..\tools\Dco mpNtfs"
    The same i copied into my new project (Also tried with typing the same path and with Absolute path)
    Strange. When I look in the quoted text when editing, the "DcompNtfs" looks right, but there's a space in the preview [and in your post]. This is probably some invisible character, so perhaps this is the cause of problems...

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  13. #13
    Registered User
    Join Date
    Mar 2008
    Posts
    10
    It is "DecompNtfs" . No space in between .

  14. #14
    Registered User
    Join Date
    Mar 2008
    Posts
    10
    May be, but i am including the first header file from "..\..\..\include\common".
    From here also it is giving error.

  15. #15
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    It could probably be that you haven't set your include path correctly and the files you are including try to include more files which they expect to be in the include path directory, which is not set.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  2. to #include or not to #include
    By krygen in forum C++ Programming
    Replies: 9
    Last Post: 12-24-2004, 11:06 PM
  3. Cannot open include file
    By SeanMSimonsen in forum C++ Programming
    Replies: 5
    Last Post: 04-02-2003, 06:33 PM
  4. Ghost in the CD Drive
    By Natase in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 10-12-2001, 05:38 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21