Mail Archives: djgpp/1999/03/06/13:38:22
>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 -