[Qt-interest] Qt plugin error: undefined reference to `MainWindow::staticMetaObject'

Thiago Macieira thiago at kde.org
Thu Apr 29 07:42:16 CEST 2010


Em Quinta-feira 29. Abril 2010, às 02.13.37, 程梁 escreveu:
> > It seems that mainwindow.cpp is properly linked into the libui library.
> 
> But
> 
> > does it contain the MainWindow destructor and the changeEvent function?
> 
> Yes, it does. I can paste code here:
> 
> #include <QtPlugin>
> #include "mainwindow.h"
> #include "ui_mainwindow.h"
> MainWindow::MainWindow(QWidget *parent) :
>     QMainWindow(parent),
>     ui(new Ui::MainWindow)
> {
>     ui->setupUi(this);
> }
> MainWindow::~MainWindow()
> {
>     delete ui;
> }
> void MainWindow::changeEvent(QEvent *e)
> {
>     QMainWindow::changeEvent(e);
>     switch (e->type()) {
>     case QEvent::LanguageChange:
>         ui->retranslateUi(this);
>         break;
>     default:
>         break;
>     }
> }
> Q_EXPORT_PLUGIN2(window, MainWindow);

Why is this Q_EXPORT_PLUGIN2 here?

This is a library, not a plugin.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100429/719b28f9/attachment.bin 


More information about the Qt-interest-old mailing list