home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!sdd.hp.com!ux1.cso.uiuc.edu!cs.uiuc.edu!sparc0b!pjl
- From: pjl@cs.uiuc.edu (Paul Lucas)
- Subject: Re: Trouble With extern declaration in g++-2.3.3
- Message-ID: <C17xI5.DoJ@cs.uiuc.edu>
- Sender: news@cs.uiuc.edu
- Organization: University of Illinois at Urbana-Champaign
- References: <C17GJ6.9Gu@dcs.ed.ac.uk>
- Date: Thu, 21 Jan 1993 19:15:41 GMT
- Lines: 31
-
- In <C17GJ6.9Gu@dcs.ed.ac.uk> nm@dcs.ed.ac.uk (Neil Mackinnon) writes:
-
- >I wonder if anyone out there could help me with a small problem I am
- >having.
-
- >I am writing classes that will be linked with code generated by another
- >program to form a simulation program that will carry out a simulation of a
- >systolic array. Within one of the classes I have a declarations
-
- > extern int NO_OF_PORTS;
- >
- > static portElem externalData[NO_OF_PORTS];
-
- >To say how many connections the array will have to the outside world.
- >it is an extern declaration because the code that is generated by my
- >main program will assign it a particular value according to the particular
- >array I am simulating. The compiler (g++-2.3.3) I am using is not allowing
- >me to generate an unlinked object file for the class but is giving me
- >the error message
-
- >../include/arrayIo.h:22: variable-size type declared outside of any function
-
- >I have not been using C++ for long and have never seen this error before
- >if anyone could help I would be most greatful.
-
- It's saying that because it's illegal. The size of static
- vectors must be known at compile-time. No exceptions.
- --
- - Paul J. Lucas
- AT&T Bell Laboratories
- Naperville, IL
-