public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7059: cannot assign a static string member of class
@ 2002-06-17 13:46 mike_mian
0 siblings, 0 replies; 2+ messages in thread
From: mike_mian @ 2002-06-17 13:46 UTC (permalink / raw)
To: gcc-gnats
>Number: 7059
>Category: c++
>Synopsis: cannot assign a static string member of class
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon Jun 17 11:46:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: mike_mian@yahoo.com
>Release: gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
>Organization:
>Environment:
solaris
>Description:
/var/tmp/ccSwJ0jF.o: In function `main':
/var/tmp/ccSwJ0jF.o(.text+0x2c): undefined reference to `myobj::s'
/var/tmp/ccSwJ0jF.o(.text+0x30): undefined reference to `myobj::s'
collect2: ld returned 1 exit status
>How-To-Repeat:
g++ bug.cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.cpp"
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKY2xhc3MgbXlvYmogewoJcHVi
bGljOgoJc3RhdGljIHN0cmluZyBzOwp9Owp2b2lkIG1haW4gKCkgewoJc3RyaW5nIHQ7CgoJdCA9
ICJvayI7CglteW9iajo6cyA9ICJidWciOwp9Cg==
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/7059: cannot assign a static string member of class
@ 2002-06-20 15:11 pme
0 siblings, 0 replies; 2+ messages in thread
From: pme @ 2002-06-20 15:11 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, mike_mian, nobody
Synopsis: cannot assign a static string member of class
State-Changed-From-To: open->closed
State-Changed-By: pme
State-Changed-When: Thu Jun 20 15:07:58 2002
State-Changed-Why:
Not a bug; your code is illegal. Static class members
must be /defined/ not just /declared/. (The linker error
about "undefined reference" provides a clue.)
You need to add
string myobj::s;
somewhere in a source file.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7059
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-06-20 22:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-17 13:46 c++/7059: cannot assign a static string member of class mike_mian
2002-06-20 15:11 pme
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).