PDA

View Full Version : Custom widget plugin linker error



Annihilator
4th March 2010, 18:34
Hi, folks. I had seen many posts on forum but didn`t resolve my issue.
I have two custom widgets. The first is from qt sdk (customwidgetplugin) and the second IconEditor (example from C++ GUI Programming with Qt 4 (Second Edition) Jasmin Blanchette and Mark Summerfield)

I compiled IconEditor successfully and got lib, exp and dll

I placed them to C:\Libs\cpp\QT\4.6\qt\plugins\designer (near customwidgetplugin and other plugins)
Also I placed sources of IconEditor to C:\Libs\cpp\QT\4.6\qt\examples\designer

I created progect "trymyplugin".

trymyplugin.pro looks like


TARGET = trymyplugin
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp
HEADERS += mainwindow.h \
iconeditor.h
FORMS += mainwindow.ui
DEPENDPATH += .
INCLUDEPATH += C:\Libs\cpp\QT\4.6\qt\examples\designer\customwidg etplugin \
C:\Libs\cpp\QT\4.6\qt\examples\designer\iconeditor plugin
LIBS += -LC:\Libs\cpp\QT\4.6\qt\plugins\designer \
-lcustomwidgetplugin \
-liconeditorplugin

AnalogClock works perfectly, but when I add IconEditor on form I get linker errors:

mainwindow.obj:-1: error: unresolved external symbol "public: __thiscall IconEditor::IconEditor(class QWidget *)" (??0IconEditor@@QAE@PAVQWidget@@@Z) referenced in function "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z)
moc_iconeditor.obj:-1: error: unresolved external symbol "public: void __thiscall IconEditor::setPenColor(class QColor const &)" (?setPenColor@IconEditor@@QAEXABVQColor@@@Z) referenced in function "public: virtual int __thiscall IconEditor::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@IconEditor@@UAEHW4Call@QMetaObject@@ HPAPAX@Z)
moc_iconeditor.obj:-1: error: unresolved external symbol "public: void __thiscall IconEditor::setIconImage(class QImage const &)" (?setIconImage@IconEditor@@QAEXABVQImage@@@Z) referenced in function "public: virtual int __thiscall IconEditor::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@IconEditor@@UAEHW4Call@QMetaObject@@ HPAPAX@Z)
moc_iconeditor.obj:-1: error: unresolved external symbol "public: void __thiscall IconEditor::setZoomFactor(int)" (?setZoomFactor@IconEditor@@QAEXH@Z) referenced in function "public: virtual int __thiscall IconEditor::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@IconEditor@@UAEHW4Call@QMetaObject@@ HPAPAX@Z)
What`s wrong. Could you help me please.