Can't use custom widget, error: undefined reference to `Custom widget
-
hello,
I build a custom widget for QT Designer. This custom widget now shows up in the QTDesigner Widgetbox and I could drag and drop it into my ui.
Here is the problem:
when I start compiling my code, there is an error undefined reference to `Custom widget. I include the .h-File of the Plugin and it seams that the linkt to the sources of my plugin are missing. so I included the .dll File of the Pluging in the .pro File LIBS += "D:/Test/customwidget.dll". but I still get the same error. Whats wrong and how can I fix this error.
Tanks for your help :) -
Hi,
You don't link against a DLL on windows but a lib file, that was generated when you compiled the plugin.
You should have something like
@LIBS += -lcustomwidget@
-
-
Hi,
At first, Do you have the MyLabelget.dll and MyLabelget.lib exist or not before your create the designer plugin?
If not, you should add xxxx.h and xxxx.cpp to your .pro file directly.
By the way, please not that, the designer plugin has nothing to do with your application, it only make sense when you design your ui.
Normally, if you want to create a library for custom widgets, you should create the library first. then create a designer plugin which depending on the first library. The plugin is optional.
-
Just to be sure: Do you have a library containing your widget and another containing your Designer plugin ?