Re: where does the header implentation get inserted
- From: Mark McIntyre <markmcintyre@xxxxxxxxxxx>
- Date: Sun, 17 Sep 2006 20:44:01 +0100
On 17 Sep 2006 09:21:14 -0700, in comp.lang.c , amit.man@xxxxxxxxx
wrote:
i think my question is misunderstood.
suppose i declare a function in "myLib.h". that function has an
implementation - lets say
that that implementation is in "myLib.c"
now if i put the line #include "myLib.h" into some code, i can use the
function of "myLib" in that code. i understand where its get the
function declaration (it's copy the lines of myLib.h into my source
code, in one way or another).
what i dont understand is where it's getting the actual function
implementation.
This is the second part of my original answer.
You have to tell the compiler to compile both files, and then tell the
linker to link the results together to make the executable.
How you do this is compiler-specific. With most compilers you can
chain the filenames together eg
$ cc file1.c file2.c
--
Mark McIntyre
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
.
- References:
- where does the header implentation get inserted
- From: amit . man
- Re: where does the header implentation get inserted
- From: CBFalconer
- Re: where does the header implentation get inserted
- From: amit . man
- Re: where does the header implentation get inserted
- From: Barry Schwarz
- Re: where does the header implentation get inserted
- From: amit . man
- where does the header implentation get inserted
- Prev by Date: Re: visit trees
- Next by Date: Re: Simple code leads to segfault.. help
- Previous by thread: Re: where does the header implentation get inserted
- Next by thread: Re: where does the header implentation get inserted
- Index(es):
Relevant Pages
|
Loading