Hi, I'm about to pull my hair out.
I have a enumerated type in a file called iap_tools.h that looks like this:
enum ChipType { master_chip, slave_chip, comm_chip };
I have a function declared in master.c that looks like this:
void start_firmware_copy( enum ChipType chip_type ){}
I have its prototype in a file called master.h, and it looks like this:
void start_firmware_copy( enum ChipType chip_type );
In master.h and master.c, I've #include "iap_tools.h", so everyone should know about the enumerated ChipType. But when I compile, I get this error:
*** ERROR C230 IN LINE 173 OF MASTER.H: 'ChipType': unknown struct/union/enum tag
So just for fun, I copy the ChipType definition into master.h, but it complains that master_chip (etc) was redefined and that ChipType was a duplicate struct/union/enum tag! It knows darn well what ChipType is! Why is it giving me an error? I use other enumerated types exactly (as far as I can tell) the way I've used ChipType, and they work just fine.
If I change the enumerated type to an unsigned char, everything compiles fine.
So does anyone have a clue what's going on here?
Thanks, -JB
I normally use C++ with namespaces containing company name for compiler symbols, and #include guards with company name.
I wonder how many files "list.h" there are in this world that are protected by #ifdef _LIST_H.