This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: undefined reference to vtable


Hi Alfkil,

I'm a former Amiga person.  I still have my Amiga 3000, although it is collecting dust.  Ahhh, memories.

> As you can see, it doesn't declare any methods virtual.

Does QWidget (or any of its base classes) declare any methods virtual?  If so, then your QUnixPrintWidget has a vtable as well.

> So why would I get the error here and not with the parent class?

Please read this explanation:
http://gcc.gnu.org/faq.html#vtables

> I've read the gcc faq section on vtable error, and read a lot of posts here and there, and I'm still not sure, that I fully understand the issue at hand.

Do a symbol dump of your QUnixPrintWidget.o (which appears to be qprintdialog_unix.o rather than QUnixPrintWidget.o ... whatever).

Is the QUnixPrintWidget vtable there?

If it's not there, does the above faq.html#vtables explanation apply?

If it is there, but isn't linkable, are you changing visibility such that the vtable is not visible outside of the translation unit?  Or perhaps not visible outside of its package (QUnixPrintWidget.library or whatever Amiga4 naming convention is these days*)?

HTH,
--Eljay

* .dll on Windows, .framework or .dylib on OS X, .so on most Unix systems, .a on some Unix systems (e.g., AIX), .library on Amiga (1.x through 3.x at least)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]