From: Norman V. <nh...@ca...> - 2002-12-04 21:35:45
|
Al Stevens writes: > Here's an odd one. The following program will not compile with 3.2. > > // test.cpp > #include <iostream> > struct Rectangle { int x; }; > int main() > { > Rectangle* rp; > return 0; > } > > gcc test.cpp -lstdc++ > > It does not like my use of Rectangle. If I change Rectangle to Rectangles or > rectangle, the program compiles. If I remove the #include <iostream> > statement, it compiles. If I change the rp declaration to struct Rectangle, > it compiles. If I use 2.95.3, it compiles. Something in 3.2 is erroneously > defining Rectangle as an object name in the global namespace, and the > compiler thinks I am multiplying whatever it thinks Rectangle is times rp, > which it reports as undeclared. The only Rectangle I've found among the > headers has to do with the winapi, but, as you can see, this program does > not use the winapi. I didn't read far enough before my earlier post <iostream> eventually includes <bits\gthr-default.h> which includes <windows.h> Cheers Norman |