Results 1 to 8 of 8

Thread: Program not linking with static image plugins

  1. #1
    Join Date
    Aug 2009
    Location
    Lancashire UK
    Posts
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Program not linking with static image plugins

    We are trying to link an application on the MAC with static libraries. We have a static build of Qt 4.5.3.
    We get 2 undefineds when linking our application (called qfire) namely:
    Undefined symbols:
    "qt_plugin_instance_qgif()", referenced from:
    __Z23qt_plugin_instance_qgifv$non_lazy_ptr in qfire.o
    "qt_plugin_instance_qjpeg()", referenced from:
    __Z24qt_plugin_instance_qjpegv$non_lazy_ptr in qfire.o

    We have specified in the .pro
    QTPLUGINS += qgif qjpeg
    and in the main cpp file
    QIMPORT_PLUGIN(qgif)
    QIMPORT_PLUGIN(qjpeg)

    The libraries libqgif.a and libqjpeg.a are in the plugins/imageformats directory.

    Any help from anyone would be greatly appreciated to avoid suicide before Christmas.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Program not linking with static image plugins

    if you compiled Qt statically then there is no opportunity to use plugins.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Sep 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Program not linking with static image plugins

    Quote Originally Posted by spirit View Post
    if you compiled Qt statically then there is no opportunity to use plugins.
    What rubbish !! What is the section on Static Plugins in the Trolltech docs talking about then ?

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Program not linking with static image plugins

    read carefully
    Plugins can be linked statically against your application. If you build the static version of Qt, this is the only option for including Qt's predefined plugins.

    When compiled as a static library, Qt provides the following static plugins:
    you can't load these plugins in run-time! i.e. they will not load dynamically. you have to link it with you app.
    Last edited by spirit; 8th December 2009 at 06:18.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. #5
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Program not linking with static image plugins

    Quote Originally Posted by dekc99 View Post
    What rubbish !!
    careful the things you say man.
    Last edited by spirit; 8th December 2009 at 06:30.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  6. #6
    Join Date
    Sep 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Program not linking with static image plugins

    No, I believe you should be more careful when answering with such resolute statements. Any person reading your reply would leave with the unfortunate (mis)understanding that "if you compiled Qt statically then there is no opportunity to use plugins. And that as we know is incorrect. That should be qualified (as you did in the later post) with the fact that a statically linked Qt cannot load plugins at runtime.

    The OP did not mention anything w.r.t. dynamically loading plugins, rather it looks like the OP's app: qfire is being statically linked with the statically built Qt libs and has
    added the various directives to the .pro and source file(s) to also "statically" include the various Qt plugins - in this case qgif and qjpeg. The OP even makes the point that the various Qt plugins are sitting in the "plugins/imageformats" directory.

    The question is why the errors after "apparently" statically including the Qt plugins ?

    Further to that question, I would include:
    - what exactly does the qmake directive QTPLUGIN (that is to added to the .pro) actually do ?
    - is that enough to then statically link in the libqgif.a and libqjpeg.a libs ?

  7. #7
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Program not linking with static image plugins

    once again, I meant that plugins (dll's,so's) can be load dynamically if you has been built statically. is it not clear?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  8. #8
    Join Date
    Aug 2009
    Location
    Lancashire UK
    Posts
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Program not linking with static image plugins

    Can I interpose here ?
    Whatever the merits/non-merits of linking dynamically, I couldn't give a ferret's goulash.
    I just want to know why I get these unresolveds and how to get rid of them.

Similar Threads

  1. Static application MSVC 2005 no image
    By bitChanger in forum Installation and Deployment
    Replies: 2
    Last Post: 26th August 2008, 13:06
  2. Replies: 16
    Last Post: 23rd May 2008, 10:12
  3. Qt 4.3 static linking on Windows
    By john_crichton in forum Installation and Deployment
    Replies: 2
    Last Post: 13th May 2008, 06:57
  4. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19
  5. Replies: 4
    Last Post: 20th February 2006, 09:11

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.