locked
fatal error C1083: Cannot open include file: 'xxxx.h': No such file or directory

    Question

  • Hi,

    I'm using Visual C++ 2005 Express, and I see that this type of error message has been giving a lot of people problems, but after trying a few of the fixes posted here, my project still gets the same error message.

    Here's a snippet of my .h file:
    //randomcard.h

    int randomcard(void)

    {
       int randomnum;

    and here's the top part of my .cpp file:

    #include <stdlib.h>

    #include <stdio.h>

    #include <ctype.h>

    #include <string.h>

    #include <time.h>

    #include "randomcard.h"

    #include <iostream>;


    Please let me know if you need anything else.  I turned off the header "stdafx.h" hoping that would fix it...but it still doesn't work.

    Thanks in advance!






    nokomis

    Saturday, December 10, 2005 12:11 AM

Answers

  • problem solved!  I just deleted the header file and created a new one...the error message went away.

    Thanks!
    Saturday, December 10, 2005 7:57 PM
  • Hi nokomis,

    Congrats!

    At first glance, C1083 error seems to not be so significant.  I think it actually means a lot. In terms of program organization, it indicates that you do not provide other separately compiled program segments  with necessary interface info. In this context, I would say that you failed to define the problem that should be solved.
    Coding is very important, of course. At the same time, program design is also important.

    Hope this helps.

    Sunday, December 11, 2005 12:20 AM

All replies

  • Hi,

     nokomis wrote:

    I'm using Visual C++ 2005 Express, and I see that this type of error message has been giving a lot of people problems, but after trying a few of the fixes posted here, my project still gets the same error message.


    Would you give us more info? If possible, give us a simple standalone code. I will try it myself. The result will be presented here ASAP!

    Saturday, December 10, 2005 3:55 AM
  • this is the generic code....it also has the same error message..

    -----------------------------------------------------------------------------


    Saturday, December 10, 2005 5:02 AM
  • Hi, I have just tried your code only to get the following error message;

    Error    1    fatal error C1083: Cannot open include file: 'randomcard.h': No such file or directory    c:\my documents\visual studio 2005\projects\randomcard\randomcard\random.cpp    6

    Note I did not include your H file.
    The result seems to indicate that your source code should compile.

    Hope this helps.
     
    Saturday, December 10, 2005 6:49 AM
  • Hi,

    You made a very simple mistake. Look at this;

    #include <iostream>;


    Saturday, December 10, 2005 6:54 AM
  • Well, I *did* include my .h file and I still get the same error message...
    Saturday, December 10, 2005 5:22 PM
  • My question is, what is the proper way to reference a header file in my C program? I have added it to my blackjackproject.cpp like this:

    CPP / C++ / C Code:
    #include <stdlib.h>
    #include <stdio.h>
    #include <ctype.h>
    #include <string.h>
    #include <time.h>
    #include "randomcard.h"

    and I have also created and added randomcard.h to the project, but am getting this error message fatal error C1083: Cannot open include file: 'randomcard.h': No such file or directory, so why is it not being seen?
    Saturday, December 10, 2005 7:27 PM
  • problem solved!  I just deleted the header file and created a new one...the error message went away.

    Thanks!
    Saturday, December 10, 2005 7:57 PM
  • Hi nokomis,

    Congrats!

    At first glance, C1083 error seems to not be so significant.  I think it actually means a lot. In terms of program organization, it indicates that you do not provide other separately compiled program segments  with necessary interface info. In this context, I would say that you failed to define the problem that should be solved.
    Coding is very important, of course. At the same time, program design is also important.

    Hope this helps.

    Sunday, December 11, 2005 12:20 AM
  • hi....

    i tried to run a program that make c++ read the data from excel... but fatal error c1083 figure out...how can i solve this problem???

    thanks....

    • Proposed as answer by Mee Nge Friday, June 19, 2009 8:05 AM
    Thursday, May 24, 2007 9:33 AM
  • Hi All,

    I have this problem, May you help me?

    d:\new inside mg\clibsample.c(4) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
    Error executing cl.exe.

    I deleted  the header file and created a new one...But the error message didn't go away.

    with thanks,
    Mee Nge
    Friday, June 19, 2009 8:07 AM
  • same problem got here, need help~~

     "fatal error C1083: Cannot open include file: 'stdlib': No such file or directory"
    Thursday, February 11, 2010 6:59 AM
  • For you I think the problem is the statement.

    Do you have

    #include <stdlib>

    as the include statement?

    If so then that is the problem. If you look above then you will notice that everyone is using stdlib.h (please note the .h extension.) The extension is required.
    Visit my (not very good) blog at http://c2kblog.blogspot.com/
    Thursday, February 11, 2010 1:42 PM