www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/21/18:30:23

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Header files
Date: Tue, 21 Apr 1998 18:19:32 -0400
Organization: Two pounds of chaos and a pinch of salt.
Lines: 28
Message-ID: <353D1B74.4C02@cs.com>
References: <353c14e5 DOT 0 AT lightning DOT ica DOT net>
NNTP-Posting-Host: ppp246.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

aalfonso wrote:
> 
> One of the examples in the book I'm reading on C++  demonstrates a class
> declaration written as a header file and then included in a .cc file that
> implements it. The program compiled successfully once I copied the header
> file into the INCLUDE directory of DJGPP-I guess this is where the compiler
> automatically looks for header files. Would this be the usual and correct
> way to compile a program with your own header file or is there another way?
> Are there command line switches that will direct the compiler to other
> directories?

You should never put your own header files into the DJGPP include
directory!  To include a user header file, simply use "" around the name
instead of <>, which will tell the compiler to look in the current
directory for the file.  Example:

#include <iostream.h>
#include "myheader.h"

If your C++ book doesn't tell you this, burn it and get a new one.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |     mailto:fighteer AT cs DOT com     |
| "Starting flamewars since 1993"  |   http://www.cs.com/fighteer/  |
|  *** NOTICE ***  This .signature |       ICQ UIN#:  7406319       |
|  is generated randomly.  If you don't like it, sue my computer.   |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019