PDA

View Full Version : plugins not recognized for static compilation



timmu
22nd February 2011, 09:00
Hi,

I'm using Qt4.4.3 (compiled statically from source and it works) to compile a program statically using plugins. I have previously been able to do this but now I'm getting error messages. Here's what I'm doing:

My main.cpp defines plugins like this:



Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
Q_IMPORT_PLUGIN(qtiff)


My hfile.h looks like this:



TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += staticlib
QTPLUGIN += qjpeg \
qgif \
qtiff

# Input
HEADERS += hfile.h draw.cpp rubberband.cpp cluster.cpp cluster2.cpp batch.cpp
SOURCES += batch.cpp cluster.cpp cluster2.cpp draw.cpp main.cpp rubberband.cpp


When I compile this I get the following error messages:

.../src/corelib/global/global.h undefined rerefence to 'qt_plugin_instance_qtiff()'
.../src/corelib/global/global.h undefined rerefence to 'qt_plugin_instance_qgif()'
.../src/corelib/global/global.h undefined rerefence to 'qt_plugin_instance_qjpeg()'

Does anyone have ideas as to what is happening? It must be some small thing because I have been able to compile the same program on the same computer before using the same static system. THANKS SO MUCH!

timmu
23rd February 2011, 08:08
Does anyone have any idea? I'd be very thankful for any kind of leads.

SixDegrees
23rd February 2011, 08:58
Undefined references arise at link time. The most common reason is that the linker is unable to locate a library, either static or dynamic, that it needs to link. Paths are the first place to check.

It can also occur when all libraries are found but none contain the symbol being searched for by the linker.

Figure out where the Qt image plugins live and put that location on your library path.

timmu
28th February 2011, 14:43
Thank you very much for your help. How do I change the library path (once I have figured out what it should be)?

Perhaps someone knows how to find out where the libraries are located? What should I look for?

I'm using Qt 4.4.3.