PDA

View Full Version : Link error in Windows



lni
14th March 2009, 02:15
Hi,

I have a class in library as:


class MY_EXPORT MyWidget : public QWidget
{
Q_OBJECT
...
};


Where in Windows, MY_EXPORT is defined as "__declspec(dllexport)"

Now I use this class to build executable by linking to its library


class DerivedWidget : public MyWidget {
Q_OBJECT
...
};.


On linking, it complains errors:

moc_DerivedWidget.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const MyWidget::staticMetaObject" (?staticMetaObject@MyWidget@@2UQMetaObject@@B)

Please help. Many thanks!

lni
14th March 2009, 05:27
Found the problem. it is related to import/export...something that is totally screwed by Microsoft...