home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19691 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.6 KB  |  43 lines

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