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

  1. Path: sparky!uunet!pipex!warwick!uknet!edcastle!dcs.ed.ac.uk!nm
  2. From: nm@dcs.ed.ac.uk (Neil Mackinnon)
  3. Newsgroups: comp.lang.c++
  4. Subject: Trouble With extern declaration in g++-2.3.3
  5. Message-ID: <C17GJ6.9Gu@dcs.ed.ac.uk>
  6. Date: 21 Jan 93 13:09:06 GMT
  7. Sender: cnews@dcs.ed.ac.uk (UseNet News Admin)
  8. Organization: Department of Computer Science, University of Edinburgh
  9. Lines: 29
  10.  
  11. I wonder if anyone out there could help me with a small problem I am 
  12. having.
  13.  
  14. I am writing classes that will be linked with code generated by another 
  15. program to form a simulation program that will carry out a simulation of a
  16. systolic array. Within one of the classes I have a declarations
  17.  
  18.       extern int NO_OF_PORTS; 
  19.     
  20.       static portElem externalData[NO_OF_PORTS];
  21.  
  22. To say how many connections the array will have to the outside world.
  23. it is an extern declaration because the code that is generated by my
  24. main program will assign it a particular value according to the particular
  25. array I am simulating. The compiler (g++-2.3.3) I am using is not allowing 
  26. me to generate an unlinked object file for the class but is giving me 
  27. the error message 
  28.  
  29. ../include/arrayIo.h:22: variable-size type declared outside of any function
  30.  
  31. I have not been using C++ for long and have never seen this error before
  32. if anyone could help I would be most greatful.
  33.  
  34.  
  35. -- 
  36. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  37. Neil A Mackinnon nm@uk.ac.ed.dcs 
  38. (Moneys not everything but comes damm close)         
  39. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  40.