[Interest] Link Errors when Creating a Windows DLL containing Qt Widgets

Thiago Macieira thiago.macieira at intel.com
Mon May 14 18:34:12 CEST 2012

On segunda-feira, 14 de maio de 2012 17.49.03, Till Oliver Knoll wrote:
> I prefer:
> class Foo : public QObject {
> public:
>   FOO_API Foo(); // c'tor
>   FOO_API virtual ~Foo();

That's a bad idea. That causes those problems of missing virtual table and 
meta object because the FOO_API was not applied to the Q_OBJECT internals nor 
the class.

If you try to derive from this class or use qobject_cast, you'll get linker 

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120514/9e2e5994/attachment.sig>

More information about the Interest mailing list