Both main.c and structures.c have structures.h as one of their include files- they are required in both files for successful compilation.

My structures.h file contains

Code:

#ifndef structures_h
#define structures_h
....
#endif

where the .... represents the everything else that is contained in the structures.h file.

My understanding was that this should prevent exactly this sort of error, because it will see that structures_h is defined, and then not include any part of the structures.h file, once it's actually been defined.

amino_acid_tlc is defined only once in all of my files, and if I remove all references to amino_acid_tlc from within the main.c file (but otherwise leave everything else exactly the same), the program compiles and links just fine.

it compiles just fine, but that doesn't explain why it is still unhappy, even after adding the #ifndef statements at the start of structures.h. I've even tried using #pragma once, and that didn't help either. Using the static keyword is just fine for my purposes, but I'd like to understand what the issue is with #ifindef or #pragma.

Please note I'm using Xcode with gcc 4.2.1.

Any suggestions / comments?
Thanks!
Brad

Last edited by bhdavis1978; 03-19-2010 at 12:25 PM.
Reason: Updating some stuff

Thanks a lot for the help, and pointing out where I would've had problems w.r.t declarations vs definitions, I appreciate it. I imagine those sorts of bugs would be difficult to track down if I didn't know the difference.