From: Martin Ambuhl Newsgroups: comp.os.msdos.djgpp Subject: Re: Including Or Not?? Date: Wed, 13 Jan 1999 05:29:22 -0500 Content-Transfer-Encoding: 7bit References: X-Posted-Path-Was: not-for-mail X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-ELN-Date: 13 Jan 1999 10:29:32 GMT X-ELN-Insert-Date: Wed Jan 13 02:35:07 1999 Organization: Nocturnal Aviation Lines: 45 Mime-Version: 1.0 NNTP-Posting-Host: 1cust7.tnt12.nyc3.da.uu.net Message-ID: <369C7582.C845C0C1@earthlink.net> X-Mailer: Mozilla 4.5 [en] (Win95; I) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com oferco wrote: > > Hello: > > consider this: > > typedef struct { > > enum { foo } goo; > > } boo; > > typedef struct loo { > > boo moo; > > } roo; > > int main() { > > roo* noo; > > noo->moo.goo = foo; > > }; > > it compiles ok when all of the above is in the same file. > BUT > if I have: > test.h - the typedefs > thst.c - main and #include "test.h" > > the compiler yells - 'foo' undeclared (first use this function) When I place the typedefs in a separate file, I get no errors other than the expected one for the illegal ';' after the closing brace and the warning for the lack of a return value. It seems you have done something else wrong. -- Martin Ambuhl (mambuhl AT earthlink DOT net) Note: mambuhl AT tiac DOT net will soon be inactive