This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31904] fail to link to static const double
- From: "fang at csl dot cornell dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 May 2007 08:06:48 -0000
- Subject: [Bug c++/31904] fail to link to static const double
- References: <bug-31904-14536@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from fang at csl dot cornell dot edu 2007-05-12 09:06 -------
You need to define Base::x out of class in some translation unit, the in-class
declaration alone isn't enough, though sometimes the compiler will elide the
reference to it if its value is known (optimization).
const double Base::x = 1.0;
--
fang at csl dot cornell dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fang at csl dot cornell dot
| |edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31904