Results 1 to 4 of 4

Thread: Qt Static Q_IMPORT_PLUGIN

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Post Qt Static Q_IMPORT_PLUGIN

    Hey trollitechies,

    I'm compiling a static qt lib with this line :

    configure -static -qt-gif -qt-zlib -qt-libmng -qt-libpng -qt-libjpeg -plugin-sql-sqlite -plugin-sql-odbc

    then I'm building it like that :

    mingw32-make sub-src

    And then I'm adding :

    Qt Code:
    1. QTPLUGIN += qjpeg \
    2. qgif
    3.  
    4. //and
    5.  
    6. LIBS += -L../../../Qt/4.3.0.static/plugins/imageformats/ -lqjpeg -lqgif\
    To copy to clipboard, switch view to plain text mode 

    to the .pro file.

    and this in the main.cpp :

    Qt Code:
    1. #include <QtPlugin>
    2.  
    3. Q_IMPORT_PLUGIN(qjpeg)
    4. Q_IMPORT_PLUGIN(qgif)
    To copy to clipboard, switch view to plain text mode 

    But :

    When compiling I get an undefined reference to qt_plugin_instance_qjpeg and qt_plugin_instance_qgif().

    What am I doing wrong ?
    Last edited by bunjee; 18th September 2007 at 12:20.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Static Q_IMPORT_PLUGIN

    First of all don't touch "LIBS". Second of all make sure appropriate statuc plugin files are available.

  3. #3
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Qt Static Q_IMPORT_PLUGIN

    Where am I supposed to find static plugin files ?

    in my \plugins\imageformats folder I have :

    - libqjpeg.a
    - libqjpeg4.a
    - qjpeg4.dll

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Static Q_IMPORT_PLUGIN

    These seem ok provided that you compile your application in release mode and that those .a files are static libraries and not import libraries for the dll. There is no gif plugin here though, so you won't be able to use it. Are you sure this is the result of the configure line you have mentioned in your first post? Are you sure those plugins were actually built?

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 10:12
  2. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13
  3. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 19:05
  4. Qt4 win opensource + mysql plugin
    By vr in forum Installation and Deployment
    Replies: 3
    Last Post: 25th May 2007, 09:01
  5. Accessing to a static variable from the same class
    By xgoan in forum General Programming
    Replies: 6
    Last Post: 5th March 2007, 10:50

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
  •  
Qt is a trademark of The Qt Company.