Unsatisfied symbols for inline pure virtual overloads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux