Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
120 user(s) are online (91 user(s) are browsing Forums)

Members: 1
Guests: 119

hotrod, more...

Support us!

Headlines

 
  Register To Post  

Undefined reference to vtable
Just can't stay away
Just can't stay away


See User information
Sorry to bother everyone again with my petty programming knowledge...

When linking a c++ project I get this strange error:

Quote:
"libQtGui.a(qprintdialog_unix.o):(.got2+0x94): undefined reference to `vtable for QUnixPrintWidget'"

The class QUnixPrintWidget (defined in 'qprintdialog.h') looks something like this:

Quote:
"class Q_GUI_EXPORT QUnixPrintWidget : public QWidget
{
Q_OBJECT

public:
QUnixPrintWidget(QPrinter *printer, QWidget *parent = 0);
~QUnixPrintWidget();
void updatePrinter();

private:
friend class QPrintDialogPrivate;
friend class QUnixPrintWidgetPrivate;
QUnixPrintWidgetPrivate *d;
Q_PRIVATE_SLOT(d, void _q_printerChanged(int))
Q_PRIVATE_SLOT(d, void _q_btnBrowseClicked())
Q_PRIVATE_SLOT(d, void _q_btnPropertiesClicked())
};"

The three methods are defined in 'qprintdialog_unix.cpp'.

I know that vtable has something to do with virtual functions, but I have no clue how it actually works. I've read ao. a gcc faq-entry that talks about this, something with "non-pure-virtual" and "out-of-line" virtual functions, but I don't really understand what it says. Can anyone help?

Go to top
Re: Undefined reference to vtable
Just popping in
Just popping in


See User information
@alfkil

Were you linking with GCC or G++? You have to do the latter if you're using C++ code so that it will link in libstdc++.

Go to top
Re: Undefined reference to vtable
Just can't stay away
Just can't stay away


See User information
@Samurai_Crow

I'm linking with g++.

I just posted on the GCC-help mailing list, hope that'll get me something...

Go to top
Re: Undefined reference to vtable
Just can't stay away
Just can't stay away


See User information
@alfkil

Sorry to have taken your time again! The problem suddenly just vanished when recompiling a larger part of the library (no changes...). Mystery...

Go to top
Re: Undefined reference to vtable
Just can't stay away
Just can't stay away


See User information
wow! interesting port! good luck!

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )



Polls
Running AmigaOS 4 on?
AmigaOne SE/XE or microA1
Pegasos2
X5000
X1000
A1222
Sam 440/460
Classic PowerPC Amiga
WinUAE emulation
Qemu emulation
Total Votes: 59
The poll will close at 2025/12/1 12:00
1 Comment


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project