home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!cs.utexas.edu!sun-barr!west.West.Sun.COM!cronkite.Central.Sun.COM!sixgun.East.Sun.COM!seven-up.East.Sun.COM!sungy!stasys!alanya!lupe
- From: lupe@ukw.uucp (Lupe Christoph)
- Newsgroups: comp.lang.c++
- Subject: Re: More Gnu C++ fun
- Message-ID: <1993Jan2.175753.20417@ukw.uucp>
- Date: 2 Jan 93 17:57:53 GMT
- References: <1992Dec30.195714.9824@adimail.uucp>
- Sender: news@stasys.sta.sub.org
- Organization: cic
- Lines: 58
-
- tel@adimail.uucp (Terry Monks) writes:
-
- >This minimal program
-
-
- >class node
- >{
- >public:
- > static int level;
- >
- > node(){};
- >};
-
- >main()
- >{
- > node::level=1;
- >}
-
-
- >compiles and links fine using the AT&T compiler from Sun, but will not link
- >under Gnu c++. (sparc-sun-sunos.4.1)
-
- >I get the message
- >ld: Undefined symbol
- > __4node$level
-
-
- >Any clues?
-
- Here is what I get from SunPro's C++ 3.0.1:
-
- alanya:~/tmp 2-> cat > x.cc
- class node
- {
- public:
- static int level;
-
- node(){};
- };
-
- main()
- {
- node::level=1;
- }
- alanya:~/tmp 3-> CC -o x x.cc
- ld: Undefined symbol
- node::level -- static member node::level should be defined in the program ,see Language Reference Manual Section 9.4
-
- Compilation failed
- Exit 2
-
- I like the pointer about the "Language Reference Manual". Bad thing
- about is that the right chapter is 9.5! :-)
- --
- | ...!unido!ukw!lupe (German EUNet, "bang") | Disclaimer: |
- | lupe@ukw.UUCP (German EUNet, domain) | This is an unofficial |
- | suninfo!alanya!lupe (Sun Germany) | opinion of Christoph & |
- | Res non sunt complicanda praeter necessitatem. | Imschweiler Consulting |
-