Results 1 to 20 of 24

Thread: imageformats plugins

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: imageformats plugins

    Quote Originally Posted by ht1 View Post
    I ran your test program on the machine that has Qt4 but I did not detect anything happening at all.
    Add CONFIG+=console to the project file, rerun qmake and rebuild the project.

    Is this program supposed to list the file extentions supported?
    Yes.

    In order to compile imageformats dll files I have to reconfigure Qt in on my computer??
    Yes.

    That sounds a bit complicated for my current knowledge
    So use the shared versions. They are much less complicated and you still haven't verified they are the ones causing trouble. Do that first before trying more tedious options like the one below.

    Are there any step by step instructions available?
    configure -help then configure <your set of switches go here> and then mingw-make or whatever your make command is.

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

    ht1 (5th January 2008)

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

    Default Re: imageformats plugins

    Thanks again, Wysota, I got your test program to work now.

    The computer that does not have Qt4 recognizes bmp, pbm, pgm, png, ppm, xbm, xpm as image files. The list is not getting longer when I put all the Qt image dll files in the "imageformats" folder.
    The computer that has Qt4 recognizes all 14 file formats as image files.
    So, what's your professional verdict? What do you think could be wrong? Many thanks!

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

    Default Re: imageformats plugins

    Quote Originally Posted by ht1 View Post
    The list is not getting longer when I put all the Qt image dll files in the "imageformats" folder.
    Could you post the full paths to that folder and the executable? Is that application compiled in release mode?

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

    ht1 (7th January 2008)

  6. #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: imageformats plugins

    Quote Originally Posted by ht1 View Post
    So, what's your professional verdict?
    My professional verdict is that your image plugins are not loaded.

    What do you think could be wrong?
    You are probably mixing debug and release mode files, you have missing dependencies or your paths are incorrect. I suspect Jacek will want to suggest at least one of the three right after you answer his questions.

    Oh, and I'd like to add one more question to his few - Could you list the exact file names of Qt libraries you have deployed on the target machine?

  7. The following user says thank you to wysota for this useful post:

    ht1 (7th January 2008)

  8. #5
    Join Date
    Nov 2007
    Posts
    47
    Thanks
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: imageformats plugins

    Wysota and Jacek, your recommendations were very good and I was able to get my program to work. Thanks! Mixed up paths was the problem.

    I'd like to pursue trying to put everytihing (all the dll files) into one exe file. I understand that I have 2 options:
    1) reconfigure my mingw
    2) obtain static versions of these dll files

    I played with reconfiguring and did not get very far. I am not sure what the configuration options are that I need to use. Has anybody recently done this with mingw? I'd be very thankful for your help.
    The second question is about obtaining these static versions of the dll files. How?

  9. #6
    Join Date
    Jan 2008
    Posts
    1
    Thanked 1 Time in 1 Post

    Default Re: imageformats plugins

    I have this problem before and it can fixed below:

    1. Assuming your program is in c:\myapp
    2. Copy imageformats folder in your program folder: c:\myapp, and you can just keep those dlls you really need.
    3. Add library path right after the initiation of the qApplication

    Should be OK

  10. The following user says thank you to banzai.ed for this useful post:

    ht1 (8th January 2008)

  11. #7
    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: imageformats plugins

    Quote Originally Posted by ht1 View Post
    I played with reconfiguring and did not get very far. I am not sure what the configuration options are that I need to use. Has anybody recently done this with mingw?
    The essential switch is "-static".

    The second question is about obtaining these static versions of the dll files. How?
    They are not distributed anywhere.

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

    ht1 (8th January 2008)

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

    Default Re: imageformats plugins

    Banzai.ed, thanks!

    I am a bit unclear how you do this:

    3. Add library path right after the initiation of the qApplication
    Do you just type in your main functions something like

    Qt Code:
    1. c:/myapp/imagefomats
    To copy to clipboard, switch view to plain text mode 

    This won't compile.

  14. #9
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: imageformats plugins

    He was talking about QCoreApplication::addLibraryPath().
    J-P Nurmi

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

    ht1 (8th January 2008)

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

    Default Re: imageformats plugins

    JPN, thanks for your clarification.
    So it looks like this is the way to add a library path?

    Qt Code:
    1. QString myPath;
    2. myPath = "c:/Qt/myapp/imageformats";
    3. application.addLibraryPath(myPath);
    To copy to clipboard, switch view to plain text mode 

    It looks like this achieves that my DLL's can be in any folder I want to put them but I still have to have separate DLL's to make my program run. I'd really like to figure out how to statically link DLL's to my executable using mingw.

  17. #11
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: imageformats plugins

    You'd start with building static version of Qt and its plugins. See our wiki for more details: [WIKI]Building static applications[/WIKI]. Make sure you pay attention to configure output. It will inform you about plugins being built. Once you have succeed building a static Qt + plugins, you will have to import static plugins to your app: Static Plugins.
    J-P Nurmi

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

    ht1 (8th January 2008)

  19. #12
    Join Date
    Nov 2007
    Posts
    47
    Thanks
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default compiler can't find plugins

    JPN, that was a very useful link, thanks.

    I got my Qt rebuilt and it now makes exe files that are idependent of mingw DLL's and that part is great.

    But when I try to use Qt plugins as explained in http://doc.trolltech.com/4.3/plugins-howto.html (I updated both main.cpp and myproject.pro as suggested in tutorial), the compiler gives me error message "can't find -lqjpg". This means it cannot find the static plugin. How do I make the compiler find it? Where is this file located? Do I need to put it in the same folder with my main.cpp when I compile? Is there more to compiling in the static mode than just typing "make" at my mingw prompt (this is all I did back when I used DLL's)?

  20. #13
    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: compiler can't find plugins

    Did you configure Qt to build static plugins? Do you have them after the built is complete?

  21. The following user says thank you to wysota for this useful post:

    ht1 (9th January 2008)

  22. #14
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: imageformats plugins

    I told you to pay attention to configure output...
    JPEG support ........ <foo>
    See "configure -help" for more details.
    J-P Nurmi

  23. #15
    Join Date
    Nov 2007
    Posts
    47
    Thanks
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: imageformats plugins

    Wysota,

    I followed the links that JPN sent me.

    First I recompiled my Qt4.3.2 for mingw as decribed here:
    http://wiki.qtcentre.org/index.php?t..._Qt_on_Windows

    Then I made all the changes in main.cpp and myproject.pro according to:
    http://doc.trolltech.com/4.3/plugins-howto.html

    In my plugins folder there are only *.a and *.dll files. There are 5 new *.a files that got created as a result of my reconfiguration of Qt according to the first link (see above). What are the extentions of static plugins and what folder should I find them in?

    No Qt*.a or Qt*.dll files in bin folder were modified or created during reconfiguration but when I compile my program now the exe is huge and looks like it is incorporating some of the plugins just probably not the imageformats plugins. When I try to copile my program in the static mode without using imageformats plugins (by not making the above-described change in main.cpp and myproject.pro) the program compiles fine and works too. It just won't do things that require imageformats plugins (like open jpg images). I think I can get most plugins incorporated but the problem is with imageformats plugins.

    You guys have been great helping me and getting me to the point where things almost work. Hopefully the last strecth is going to make things fully work.
    Thanks.

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

    Default Re: imageformats plugins

    Hi Wysota,

    I now rebuilt my Qt4.3.3 froum source by doing:
    Qt Code:
    1. prompt> configure -static -release -no-exceptions
    2. prompt>make sub-src
    To copy to clipboard, switch view to plain text mode 
    I then put the following in my main.cpp
    Qt Code:
    1. #include <QtPlugin>
    2. Q_IMPORT_PLUGIN(qjpeg)
    3. Q_IMPORT_PLUGIN(qgif)
    4. Q_IMPORT_PLUGIN(qmng)
    To copy to clipboard, switch view to plain text mode 
    and the following in myproject.pro
    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 
    Still the compilation is not happening. I get "cannot find -lqjpg".
    When I remove what I put in main.cpp (see above) and I remove "QTPLUGIN += qjpg \ qgif \ qmng" then the program compiles fine and works, too but cannot open image files other than BMP.
    So I think that I either don't have the proper plugins or I declare them wrong.
    My question is: what does a static plugin file look like? What name, what extention, where does it reside? Is it possible that I did not build static plugins when I compiled Qt from source as described above?

Similar Threads

  1. Qt Plugins Error
    By nathanpackard in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2007, 23:19
  2. Nightmares with plugins
    By KShots in forum Qt Programming
    Replies: 6
    Last Post: 8th February 2007, 16:46
  3. Qt plugins - how to do a libtool-style autoload
    By KShots in forum Qt Programming
    Replies: 2
    Last Post: 7th February 2007, 12:40
  4. Arthur Plugins demos and designer
    By antonio.r.tome in forum Installation and Deployment
    Replies: 4
    Last Post: 21st March 2006, 14:01
  5. Plugins as small application
    By blackliteon in forum Qt Programming
    Replies: 4
    Last Post: 12th January 2006, 09:39

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.