This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
symbols not resolved... symbols not generated?
- From: Brian Budge <brian dot budge at gmail dot com>
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 17 Apr 2009 16:24:03 -0700
- Subject: symbols not resolved... symbols not generated?
Hi all -
I'm running into an issue using static const variables in my template
class, but only with -O0. I have something like this:
Bar.h
template <typename Foo>
class Bar {
...
public:
typedef uint32_t SomeType;
static const SomeType A = 0;
static const SomeType B = 1;
static const SomeType C = 2;
...
};
These types are used in Bar member functions, as well as by Foo (who
knows who he is an argument for).
In -O1 and above, it looks like the symbols are never generated, and
this is fine since it's probably folded into the code. In O0, which
I'm using for debugging, the symbols appear in my object file as 'U'
(unresolved).
I can't seem to make a simple repro case for this, but I thought I'd
throw this up here to see if I'm doing something stupid, or if this is
a bug in gcc (version 4.3.3-5).
Thanks,
Brian