delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/06/13:38:22

X-Sender: john_meyer AT mail DOT geocities DOT com
Message-Id: <l03130306b30719b02f86@[158.142.75.61]>
In-Reply-To: <36E133EB.C8D501BC@ort.org.il>
Mime-Version: 1.0
Date: Sat, 6 Mar 1999 11:44:15 -0600
To: djgpp AT delorie DOT com
From: John Meyer <john_meyer AT geocities DOT com>
Subject: Re: project
Reply-To: djgpp AT delorie DOT com

>I have a problem with the PROJECT option in DJGPP :
>
>for example I to my project the files : file1.cpp , file2.cpp
>
>I include H files in file1.cpp , but if I need to use a few functions
>from the same H files in file2.cpp I need to include the H files again.
>When I compile and run the project , it writes me an error  that I
>declared the same H files twice.
>
>How do I fix it?

Okay, assuming that your header files are written by you, you have to put a
sentinel in each of them.


#ifdef MYHEADER_H       //notice the caps and underscore
#define MYHEADER_H


//code goes here


#endif




- Raw text -


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