This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Unsatisfied symbols for inline pure virtual overloads
- From: "Thomas Matelich" <matelich at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 14 Aug 2006 15:18:12 -0700
- Subject: Unsatisfied symbols for inline pure virtual overloads
I recently upgraded to gcc 4.1.1 on HP-UX 11i (hppa2.0w-hp-hpux11.11).
I'm using the depots from the hp porting center. I've already ported
this code to g++ 4.0.x on Linux, so I wasn't expecting any surprises.
So far things have gone pretty well except this one case that has
popped up a couple of times. I haven't made a successful test case
yet, I thought I'd put this out and try to get it happening.
class Base
{
public:
virtual int foo() const = 0;
};
class Derived
{
public:
int foo() const { return f; }
private:
int f;
};
I'm getting unsatisfied symbols on Derived::foo(). I've run into it
twice now in my source base. I tried fixing it by adding a
void foo_dependent()
{
Derived d;
d.foo();
}
function to my .cpp file. This didn't work. One thing I just noticed
on my latest case is that this function isn't even called from the .o
that is complaining. There is, however, another inline function in
Derived that is calling foo. This is also happening the other case.
Oh, and I do have a pretty easy work around of moving the
implementation to the cpp file, I'd prefer not to. I have a feeling
I'll hit this will happen more when I move into the rest of our source
base.
Thanks,
Tom