multifile project
From: Anders Christensen (andersc1_at_hotmail.com)
Date: 05/20/05
- Next message: Peter T. Breuer: "Re: multifile project"
- Previous message: Josef Moellers: "Re: union field length mismatch"
- Next in thread: Peter T. Breuer: "Re: multifile project"
- Reply: Peter T. Breuer: "Re: multifile project"
- Reply: Kasper Dupont: "Re: multifile project"
- Reply: phil-news-nospam_at_ipal.net: "Re: multifile project"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 20 May 2005 13:47:57 +0200
I'm writing a program with multiple files. I need some good advices on
how to handle the include's. Brief explaination of the situation:
I have a "main.c" and some header-/source files *.c and *.h .
In the top of "main.c" I include the headerfiles "first.h", "second.h" and
"last.h". From "main.c" I'm now able to access the functions and variables
that are declared/defined in the header/soucefiles.
The problem is that I'd like the functions/variables from "first.c" to be
accessable from within "second.c" and "last.c". Therefore, in the top of
"second.c" and "last.c" respectively, I include the headers "second.h" and
"last.h".
Moreover, I'd like functions and variables from "first.c" and "second.c"
to be known in "last.c", so in the top of "last.c" i include the two
headerfiles "first.h" and "second.h".
I compile the program with the command
gcc main.c first.c second.c last.c -o prog
This actually worked out fine for a long time, but now I get some
strange errors as I try to expand the project with more
source-/headerfiles.
All my headers are protected by #ifndef
Is it the wrong way I do the includes? Any suggesions?
./Anders.
- Next message: Peter T. Breuer: "Re: multifile project"
- Previous message: Josef Moellers: "Re: union field length mismatch"
- Next in thread: Peter T. Breuer: "Re: multifile project"
- Reply: Peter T. Breuer: "Re: multifile project"
- Reply: Kasper Dupont: "Re: multifile project"
- Reply: phil-news-nospam_at_ipal.net: "Re: multifile project"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]