![]() |
need help with undefined reference errors
I'm getting the following undefined reference errors:
foo_test.o(.gnu.linkonce.t._ZN7CFooD1Ev+0x18): In function `CFoo::~CFoo()': : undefined reference to `vtable for CFoo' foo_test.o(.gnu.linkonce.t._ZN7CFooC1Ev+0x19): In function `CFoo::CFoo()': : undefined reference to `CFoo::rmap' foo_test.o(.gnu.linkonce.t._ZN7CFooC1Ev+0x30): In function `CFoo::CFoo()': : undefined reference to `vtable for CFoo' The implementation of the concerned functions is given below. I'm pretty sure it is reading the file. What exactly could be going wrong? ------------------------------------------------------------------------------------------------------------------ class CFoo : public CIFoo { public: CFoo() : CIFoo( PID_FOO, rmap) {}; CFoo( const CFoo& c ) : CIFoo( PID_Foo, rmap ) { } ~CFoo() { } private: char* rmap; }; |
Re: need help with undefined reference errors
Without the full source code, I am guessing the base class `CIFoo' has
no virtual destructor. |
Re: need help with undefined reference errors
boyphp wrote:
> I'm getting the following undefined reference errors: > > foo_test.o(.gnu.linkonce.t._ZN7CFooD1Ev+0x18): In function > `CFoo::~CFoo()': >> undefined reference to `vtable for CFoo' > foo_test.o(.gnu.linkonce.t._ZN7CFooC1Ev+0x19): In function > `CFoo::CFoo()': >> undefined reference to `CFoo::rmap' > foo_test.o(.gnu.linkonce.t._ZN7CFooC1Ev+0x30): In function > `CFoo::CFoo()': >> undefined reference to `vtable for CFoo' > > The implementation of the concerned functions is given below. I'm > pretty sure it is reading the file. What exactly could be going wrong? [..] Quoting the Standard: "A virtual member function shall be declared pure _or_ defined _or_ both." That means you cannot declare a virtual function but not define it. Also, it's possible that the base class of CFoo has pure d-tor... The cod you posted does not have enough information in it. V -- Please remove capital 'A's when replying by e-mail I do not respond to top-posted replies, please don't ask |
| All times are GMT. The time now is 07:07 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.