Ok so I have one main.c file, multiple .c files. Each .c file has a corresponding .h file. Every .c file and .h file has a ifndef statement at the top, and an endif at the bottom (so it doesn't get defined multiple times). All of the .c files have an include of their equivalent .h file at the top (right underneith the ifndef stuff), and every .h file has an include of its corresponding .c file at the bottom (right above the endif). The .c files contain the actual functions, and the .h files contain the coresponding function prototypes, as well as some variables. The .h files also contain some #define things, that the functions use. Other .c files need to use some of these #define's though too, and this is where I am running into problems... because the other functions cannot see them.
An example... lets say I have mystuffA.c, mystuffA.h, mystuffB.c, and mystuffB.h. So mystuffA.c needs to use #defines from mystuffB.h, and mystuffB.c needs to use some #defines out of mystuffA.h
In the main.c file, at the top, I am only including all of the .h files. To get all my stuff to compile, I had to pull some of those #define statements out of the .h files, and put them in the main.c file, above all of the .h includes.
Last edited by Mahonroy; 02/09/12 20:03.