[Qt-interest] Undefined reference to (any custom widget)
Stephen Jackson
spjackson42 at gmail.com
Sat Feb 27 16:07:17 CET 2010
On 27 February 2010 11:50, Robert Wood wrote:
> I'm trying to work out how to get a custom widget working with creator
> that has been placed onto a form in designer.
>
> I can compile carious custom widgets that I have from the example files
> or downloaded from the web. I can compile them, copy the the .so file to
> my /opt/qtsdk-2010.02/qt/plugins/designer/ directory and copy the header
> file to /usr/lib/qt4/include/
>
> They then appear in designer.
>
Placing the .so there enables designer to find the plugin, but I don't
think that the link step looks there automatically.
> However, even with off-the-shelf widgets such as this:
>
> http://qt-apps.org/content/show.php/QLed+?content=72482
>
> I get:
>
> /home/robertw/Software/Qt4/Qt4Test/ui_mainwindow.h:59: undefined
> reference to `QLed::QLed(QWidget*)'
>
> There are a few reference to this round the web, such as:
>
> "Just add to your .pro file:
> LIBS += -lqledplugin"
>
> None of which work.
>
So the .so is called libqledplugin.so, correct?
Don't you also get an error indicating that the library cannot be found?
I think you would need
LIBS += -lqledplugin -L/opt/qtsdk-2010.02/qt/plugins/designer
unless you also copy the .so to a directory that you know will be
searched in the link.
--
HTH,
Stephen Jackson
More information about the Qt-interest-old
mailing list