Results 1 to 20 of 23

Thread: where/what are static plugins?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: where/what are static plugins?

    Those plugins are named "qjpeg", "qgif" and "qmng".

  2. The following user says thank you to jacek for this useful post:

    ht1 (14th January 2008)

  3. #2
    Join Date
    Nov 2007
    Posts
    47
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    34

    Default Re: where/what are static plugins?

    The plugins that I have in my "plugins/imageformats" are not qjpeg, qgif and qmng. They are libqgif.a, libqjpeg.a, libqmng.a, libqsvg.a, libqtiff.a.
    Does that mean I failed to build static plugins?
    How do you build static plugins with mingw?

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: where/what are static plugins?

    Quote Originally Posted by ht1 View Post
    They are libqgif.a, libqjpeg.a, libqmng.a, libqsvg.a, libqtiff.a.
    No these are files with plugins inside. Just remove the "lib" prefix from .pro file and macros in main.cpp.

  5. The following user says thank you to jacek for this useful post:

    ht1 (14th January 2008)

  6. #4
    Join Date
    Nov 2007
    Posts
    47
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    34

    Default Re: where/what are static plugins?

    Jacek, thanks,

    Now myproject.pro is
    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3. DEPENDPATH += .
    4. INCLUDEPATH += .
    5. CONFIG += staticlib
    6. QTPLUGIN += qjpg \
    7. qgif \
    8. qmng
    To copy to clipboard, switch view to plain text mode 
    but I'm still getting "cannot find -lqjpg". I tried to compile with and without this is main.cpp:

    Q_IMPORT_PLUGIN(qjpeg)
    Q_IMPORT_PLUGIN(qgif)
    Q_IMPORT_PLUGIN(qmng)

    but still I get the "cannot find -lqjpg" error.

    Is there anything else I could try to diagnose the problem? Thanks

  7. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: where/what are static plugins?

    It should be qjpeg.

  8. The following user says thank you to jacek for this useful post:

    ht1 (15th January 2008)

  9. #6
    Join Date
    Nov 2007
    Posts
    47
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    34

    Default Re: where/what are static plugins?

    Thanks, I changed "qjpg" to "qjpeg" in the *.pro file. Now the compiler says:

    main.cpp: undefined reference to 'qt_plugin_instance_qjpeg()'
    main.cpp: undefined reference to 'qt_plugin_instance_qgif()'
    main.cpp: undefined reference to 'qt_plugin_instance_qmng()'

    Is it possible that my static plugins are in the wrong folder? Where do they need to be?

  10. #7
    Join Date
    Nov 2007
    Posts
    47
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    34

    Default Re: where/what are static plugins?

    I was wondering that perhaps there is something wrong with the way I declare the plugins in my main.cpp. This is how I do it:

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

    Is there anyone out there who has compiled Qt4 statically and has linked imageformat plugins statically to the executable? I have tried just about every combination of everything but nothing works. This problem is causing me a major problems. Thanks!

  11. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: where/what are static plugins?

    Do you use qmake from the static Qt build?

  12. The following user says thank you to jacek for this useful post:

    ht1 (16th January 2008)

  13. #9
    Join Date
    Nov 2007
    Posts
    47
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    34

    Default Re: where/what are static plugins?

    Yes, indeed, I use QMAKE from static Qt build. Also, I am able to incorporate other static plugins no problem, just not the imageformat static plugins. Taking these plugins out makes the program to compile fine but unable to handle image files (because the plugins were not incorporated). So, I think the compiler is fine and the code is fine. It's either that imageformat plugins have a problem, or I do not declare them right, or they are not in the right folder.

  14. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: where/what are static plugins?

    Could you post the command used to link your application (the one where the g++ is invoked with -l options)?

    Do you get any other error messages apart from "undefined reference to qt_plugin_instance_xxx"?

  15. The following user says thank you to jacek for this useful post:

    ht1 (16th January 2008)

  16. #11
    Join Date
    Nov 2007
    Posts
    47
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    34

    Default Re: where/what are static plugins?

    Great, Jacek, you may have figured out what the problem is. I do not know how to link properly using the command line. I've been doing:

    1) prompt>qmake -project
    2) then manually add the plugin info to the myproject.pro as shown in an earlier post
    3) prompt>qmake
    4) prompt>make

    I guess I have to use -l in step 4?? How?
    Thanks again

  17. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: where/what are static plugins?

    Quote Originally Posted by ht1 View Post
    I guess I have to use -l in step 4?? How?
    Actually make should do that for you. What is the last command it runs?

  18. The following user says thank you to jacek for this useful post:

    ht1 (16th January 2008)

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 10:12
  2. Qt Plugins Error
    By nathanpackard in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2007, 23:19
  3. Accessing to a static variable from the same class
    By xgoan in forum General Programming
    Replies: 6
    Last Post: 5th March 2007, 10:50
  4. static objects in libraries
    By Rawk in forum Qt Programming
    Replies: 3
    Last Post: 16th January 2007, 19:03
  5. Qt4 Plugins How-to
    By Chaid in forum Qt Programming
    Replies: 4
    Last Post: 8th July 2006, 08:32

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.