home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18739 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  959 b 

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsk!cbnewsj!att-out!rutgers!mcdhup!src4src!wozzle!alane
  2. From: alane@wozzle.linet.org (J. Alan Eldridge)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: More Gnu C++ fun
  5. Message-ID: <uu5TwB3w165w@wozzle.linet.org>
  6. Date: 4 Jan 93 04:26:29 GMT
  7. References: <1992Dec30.195714.9824@adimail.uucp>
  8. Organization: Disorganization
  9. Lines: 37
  10.  
  11. tel@adimail.uucp (Terry Monks) writes:
  12.  
  13. > This minimal program
  14. > class node 
  15. > {
  16. > public:
  17. >   static int level;
  18. >   
  19. >   node(){};
  20. > };
  21. > main()
  22. > {
  23. >   node::level=1;
  24. > }
  25. > compiles and links fine using the AT&T compiler from Sun, but will not link
  26. > under Gnu c++.  (sparc-sun-sunos.4.1)
  27. > I get the message
  28. > ld: Undefined symbol
  29. >    __4node$level
  30.  
  31. Try adding:
  32.  
  33. int node::level;
  34.  
  35. to your code at file scope.
  36.  
  37. Should clear it right up.
  38.  
  39. alane@wozzle.linet.org (J. Alan Eldridge)
  40. Fido: The University of Walamaloo 1:272/38.473
  41.