Mail Archives: djgpp/1997/07/09/16:39:04
TDR wrote:
>
> How can I make a header files for my source... I always get an error
> "don't know how to make blah.o from blah.h" I just want to have a
> multiple file project and I am using RHIDE...
This looks to be more of a C question than a DJGPP question, but here's
your answer, straight from the FAQ:
-----------------
10.6: I'm splitting up a program into multiple source files for the
first time, and I'm wondering what to put in .c files and what to put in
.h files. (What does ".h" mean, anyway?)
A: As a general rule, you should put these things in header (.h) files:
macro definitions (preprocessor #defines)
structure, union, and enumeration declarations
typedef declarations
external function declarations (see also question 1.11)
global variable declarations
It's especially important to put a declaration or definition in a
header file when it will be shared between several other files. (In
particular, never put external function prototypes in .c files. See
also question 1.7.) On the other hand, when a definition or declaration
should remain private to one source file, it's fine to leave it there.
See also questions 1.7 and 10.7.
------------------------
Get the comp.lang.c FAQ list for more information
- Raw text -