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

Thiago Macieira thiago at kde.org
Thu Apr 29 18:26:28 CEST 2010


Em Quinta-feira 29 Abril 2010, às 15:00:28, 程梁 escreveu:
> Now I think I should create a plugin, not a library, am I right? Then the
> macro
> Q_EXPORT_PLUGIN2 should be added, too.
> 
> OK, now the question is when I added this macro, the compiler error is
> "undefined reference to `MainWindow::~MainWindow()'" and so on. Then how to
> solve
> this problem? I'll paste my project here.
> 
> Thank you for help me!

Remember that you can't use symbols from the plugin in the main application. 
You can only use the base classes, like QObject, QWidget, QMainWindow and 
QGraphicsView.

So you must not write "MainWindow" in the application. If you do, that's an 
error.

-- 
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/559eb21b/attachment.bin 


More information about the Qt-interest-old mailing list