I have a problem that is manifest with the AVR compiler [g++ (WinAVR 20100110) 4.3.3] somehow not seeing enums when they are declared or defined in a header.
I have two files:
//main.h
enum {X, Y} Foo;
//main.cpp
#include "main.h"
....code ....
Foo f = X;
When I build it I get 'Symbol X could not be resolved'. Oddly, when I make other files main1.cpp, main2.cpp, etc., I can see some of Foo's members, some of the time ... but some of them never are visible (come to think, it seems to be file by file ... so if main2.cpp can see any, it can see all; and if any are hidden, all are ... hmmm.... ).
On the other hand, if I just copy and past the declaration of Foo into main.cpp, all is well. Other symbols declared in main.h are visible with no problems, so it is not a matter of including the wrong file, etc.
Anyone seen this?
W