Results 1 to 4 of 4

Thread: plugins not recognized for static compilation

  1. #1
    Join Date
    Aug 2009
    Posts
    122
    Thanks
    74
    Qt products
    Qt4
    Platforms
    Windows

    Question plugins not recognized for static compilation

    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:

    Qt Code:
    1. Q_IMPORT_PLUGIN(qjpeg)
    2. Q_IMPORT_PLUGIN(qgif)
    3. Q_IMPORT_PLUGIN(qtiff)
    To copy to clipboard, switch view to plain text mode 

    My hfile.h looks like this:

    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3. DEPENDPATH += .
    4. INCLUDEPATH += .
    5. CONFIG += staticlib
    6. QTPLUGIN += qjpeg \
    7. qgif \
    8. qtiff
    9.  
    10. # Input
    11. HEADERS += hfile.h draw.cpp rubberband.cpp cluster.cpp cluster2.cpp batch.cpp
    12. SOURCES += batch.cpp cluster.cpp cluster2.cpp draw.cpp main.cpp rubberband.cpp
    To copy to clipboard, switch view to plain text mode 

    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!

  2. #2
    Join Date
    Aug 2009
    Posts
    122
    Thanks
    74
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: plugins not recognized for static compilation

    Does anyone have any idea? I'd be very thankful for any kind of leads.

  3. #3
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: plugins not recognized for static compilation

    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.

  4. The following user says thank you to SixDegrees for this useful post:

    timmu (28th February 2011)

  5. #4
    Join Date
    Aug 2009
    Posts
    122
    Thanks
    74
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: plugins not recognized for static compilation

    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.

Similar Threads

  1. where/what are static plugins?
    By ht1 in forum Qt Programming
    Replies: 22
    Last Post: 18th August 2013, 11:42
  2. Error in static compilation of Qt 2010.05!
    By elton.lika in forum Newbie
    Replies: 5
    Last Post: 26th January 2011, 21:37
  3. Program not linking with static image plugins
    By andyp in forum Qt Programming
    Replies: 7
    Last Post: 8th December 2009, 10:15
  4. Use static plugins in dynamic Qt project
    By uj2 in forum Installation and Deployment
    Replies: 1
    Last Post: 31st August 2009, 19:54
  5. Problems loading static plugins
    By Rodrigo in forum Qt Programming
    Replies: 2
    Last Post: 11th July 2007, 12:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.