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

Michael Jackson imikejackson at gmail.com
Mon May 14 17:24:04 CEST 2012


On May 14, 2012, at 11:17 AM, Till Oliver Knoll wrote:

> 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 ...
> 
> instead?
> 
> 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).
> 
> Cheers,
>  Oliver
> 

Putting "PipelineBuilderLib_EXPORT" before the "class" keyword just results in a bunch of compiler warnings indicating that this is not the way to do it. I have checked and checked again that the source files generated by the moc process are included in the compile. I see them go by in the compiler output. My VS fu isn't really strong enough to figure this out. 

Thanks for the suggestions though. I'll try anything at this point. 

Mike Jackson


More information about the Interest mailing list