delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/08/21:06:30

From: "Dennis Cartwright" <dori DOT den AT worldnet DOT att DOT net>
Newsgroups: comp.os.msdos.djgpp
References: <T3J56.3826$fj6 DOT 312051 AT bgtnsc05-news DOT ops DOT worldnet DOT att DOT net> <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: <olu66.22195$7f3.1565205@bgtnsc07-news.ops.worldnet.att.net>
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 <dontmailme AT iname DOT com> 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 <stdlib.h>
> > #include <time.h>
> > #include <iostream>
> >
> > 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<Player>, 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).


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019