Help with making header files

This is a discussion on Help with making header files within the C++ Programming forums, part of the General Programming Boards category; Hello everyone, I just finished writing this incredibly long code, and I'm really exited about it. As always, it is ...

  1. #1
    hacker in training AdamLAN's Avatar
    Join Date
    Sep 2004
    Posts
    56

    Help with making header files

    Hello everyone,
    I just finished writing this incredibly long code, and I'm really exited about it. As always, it is impossible to get zero errors in the first compile. I was expecting at least a hundred, but instead I was suprised to see only about five. I've fixed all of the bugs up until one of them. The program uses a header file that i create (i have MSVC++.NET, so i put it into the solution), and it can't seem to find it. I use it by saying "#include <evolution.h>"

    I'm not sure if I have to top part of the header file written correctly:
    #IF NDEF "evolution.h"
    DEFINE "evolution.h"
    #ENDIF

    If anyone can offer any assistance, it would be nice.

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,805
    The way to do is this.
    Code:
    #ifndef evolution_h
    #define evolution_h
    
    //header goods here
    
    #endif//evolution_h
    Woop?

  3. #3
    hacker in training AdamLAN's Avatar
    Join Date
    Sep 2004
    Posts
    56
    Thanks

  4. #4
    #include<xErath.h> xErath's Avatar
    Join Date
    Jun 2004
    Posts
    722
    If you're including a header that belongs to the compiler libs use
    #include <header>
    If your using your own header use - note: that the header file name can be a relative path
    #include "header"
    #include "..\dir\header"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Confusion on header and source files
    By dnguyen1022 in forum C++ Programming
    Replies: 4
    Last Post: 01-17-2009, 02:42 AM
  2. C Header Files
    By devarishi in forum C Programming
    Replies: 8
    Last Post: 12-10-2008, 03:53 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  4. Making Classes header files.
    By RealityFusion in forum C++ Programming
    Replies: 13
    Last Post: 08-23-2003, 11:54 AM

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