From: "Dennis Cartwright" Newsgroups: comp.os.msdos.djgpp References: <3a577144 DOT 7807328 AT news DOT freeserve DOT net> Subject: Re: "internal compiler error" Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Tue, 09 Jan 2001 02:05:08 GMT NNTP-Posting-Host: 12.73.8.220 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc07-news.ops.worldnet.att.net 979005908 12.73.8.220 (Tue, 09 Jan 2001 02:05:08 GMT) NNTP-Posting-Date: Tue, 09 Jan 2001 02:05:08 GMT Organization: AT&T Worldnet To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Thanks, D Steamer wrote in message news:3a577144 DOT 7807328 AT news DOT freeserve DOT net... > Dennis Cartwright wrote: > > > The following code is from the beginning stages of a prog I am > > writing to simulate a "hold em" poker game. > > When I compile with gcc -c PokerA.cpp, I get the following error > > message: > > > > PokerA.cpp In method void Table::firstDeal()': > > Pokeraccpp : 146: Internal compiler error in `find_function_data' at > > function c:542 > > Please submit a full bug report > > See http://www.gnu.org/software/gcc/faq.html#bugreport > > > > Before I attempt to submit a bug report, does anyone see an error in my > > code that I might be overlooking, or does anyone see a workaround I might > > put in? > > Your code is wrong. But, of course, internal compiler errors > shouldn't occur even for incorrect code. > > > #include > > #include > > #include > > > > int NP; // number of players > [snip lots of code] > > class Table { > > private: > > Player p[NP]; > > Here's the problem. The value of NP isn't known (and NP > isn't even const), so you can't define the structure of > a class in terms of it. One solution would be to make > Table::p a std::vector, and initialize it to the > correct size in the constructor. Another solution is to > make Table::p a pointer and allocate some memory for it > in the constructor (and delete it in the destructor).