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

Till Oliver Knoll till.oliver.knoll at gmail.com
Mon May 14 17:17:12 CEST 2012

Am 14.05.2012 um 16:35 schrieb Mike Jackson <imikejackson at gmail.com>:

> ...
> This is the top part of the class declaration for QFilterWidget:
> class PipelineBuilderLib_EXPORT QFilterWidget : public QGroupBox
> {
>    Q_OBJECT;
>  public:

Could it be that it needs to be:

PipelineBuilderLib_EXPORT class WFilterWidget : public ...


I usually just export single (public or protected) fields and methods instead of the whole class. But I think that __decl-stuff has to go before the class keyword to take effect.

However from the link errors it seems that the moc'ed symbols are somehow not linked into your DLL at all (as opposed to "not exported"). Did you try a 'make distclean; make'? Check for the corresponding moc_* compiler lines in the compiler/linker output when compiling your DLL (make sure the moc'ed files get properly updated/generated and compiled/linked).


More information about the Interest mailing list