Re: problem with multiple source file
- From: pereges <Broli00@xxxxxxxxx>
- Date: Tue, 8 Apr 2008 07:27:34 -0700 (PDT)
On Apr 8, 7:05 pm, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
pereges <Brol...@xxxxxxxxx> writes:
I hae compiled and executed codes of vector.c, reader.c , test.c
seperately and they can be execute in proper manner and give correct
outputs but when i tried to integrate them all into a single project
using pelles C it is giving two many errors.
You could help people out with an error message!
You have got tied up in includes, trying to get common.h to do
everything. It can be done like that, but if when, say, test. include
common.h which needs reader.h which tries to get what it wants from
common.h (you just have to go thought this carefully by hand or using
something like gcc -E to see that it does not work).
Get rid of common.h and have every file include what it needs. You
can have one .h file that includes another if you like that style but
circular includes will tie you in knot.
I could post error messages but theres just way too many. I think
change my approach. In my project, vector data structure and
operations are meant to be seen by every module so I will put that it
into common.h along with some common header files like stdio, stdlib ,
string and math which are needed almost every module. Suppose
all.h
a.h a.c
b.h b.h
c.h c.c
Now each of the .h's file should include all.h and every .c file will
include its corresponding .h file. I think then in main.c you need to
include all the headers including all.h
.
- Follow-Ups:
- Re: problem with multiple source file
- From: CBFalconer
- Re: problem with multiple source file
- From: Ben Bacarisse
- Re: problem with multiple source file
- References:
- problem with multiple source file
- From: pereges
- Re: problem with multiple source file
- From: Ben Bacarisse
- problem with multiple source file
- Prev by Date: Re: How to make it faster?
- Next by Date: Re: Why would someone use c++ compiler on a C code?
- Previous by thread: Re: problem with multiple source file
- Next by thread: Re: problem with multiple source file
- Index(es):
Relevant Pages
|