Thread: header files

  1. #1
    Registered User
    Join Date
    Dec 2001

    Angry header files

    I am usnig Windows98 and Visual studio 6.0 programming in C.

    The assignment that I am working on has the requirement to use a header file that we create and include in the c code. I have created the header file in the usual way by going to file, new and then choosing c/c++ header file. The name of the file is assign12.h. When I try to include this file I get the error that it does not exist. It has been saved, along with my project. The file names are typed correctly.

    My instructor in class said that you create the file in the same manner as a standard C file. She never said that we have to do anything else.

    Many thanks to whoever can help me.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Waterloo, Texas
    Is the header in the same directoriy as the program?

  3. #3
    Registered User
    Join Date
    Dec 2001
    The header file is in the same directory as the c source code.

  4. #4
    Registered User
    Join Date
    Aug 2001
    Did you try to save it in the same folder as the rest of the headers?

  5. #5
    Registered User
    Join Date
    Sep 2001
    Hmm... could we see...
    1) The #include statements in your source file...
    2) The name of the header file, and
    3) The contents of the headerfile
    Callou collei we'll code the way
    Of prime numbers and pings!

  6. #6



    I think probably the most likely explanation is that you are trying to use a #include line like a library header :

    #include <assign12.h>

    rather than the way you need to :

    #include "assign12.h"

    the difference is that the compiler looks in a different directory for ones surrounded with < > than " ". Make sure you still use < > for any includes that were already there, you can't just replace all of them with " ".

    Hope this helps

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  2. #include header files or .cpp files?
    By DoctorX in forum C++ Programming
    Replies: 3
    Last Post: 12-23-2006, 12:21 PM
  3. classes and header files
    By Drake in forum C++ Programming
    Replies: 8
    Last Post: 11-30-2006, 07:12 PM
  4. Request for comments
    By Prelude in forum A Brief History of
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM