Results 1 to 6 of 6

Thread: How to deal with jpeg deployment problem with Visual C++ compiler

  1. #1
    Join Date
    Nov 2007
    Posts
    53
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default How to deal with jpeg deployment problem with Visual C++ compiler

    Hi everybody,

    As I've banged hy head all the week-end with it, trying a lot of stuffs, reading a lot of stuffs too on this forum and in the Qt doc, I will post a little how-to.

    With Visual C++, having jpeg working on another fresh computer is not as simple as copying the qtjpeg4.dll in a imageformats subfolder... It is really frustrating to discover that after discovering that jpeg is a plugin and that it should work this way.

    It works perfectly with MinGW but not with Visual C++.

    The first thing to do to have it working is to definitely forget about a local installation of the Microsoft Visual C++ run-time (so in the same folder than the app). In this way, the jpeg plugin won't work.

    So, you will have to install the Visual C++ redist system wide with the installer vcredist_x86.exe that you can found on the Microsoft Website.

    It is possible to install it silently : http://blogs.msdn.com/astebner/archi...-packages.aspx

    This is the way I do with the NSIS installer (but if someone know how to forbid or warn if the user wants to remove the Visual C++ redist separately, don't hesitate to post on the thread ;o)).

    But this is not enough. Don't esperate to have the jpeg plugin working by putting it in the app subfolder.

    You should write a qt.conf file in the app folder on the target machine :

    Qt Code:
    1. [Paths]
    2. Plugins = plugins
    To copy to clipboard, switch view to plain text mode 

    If you do like above, you should place the qtjpeg4.dll in the subfolder plugins\imageformats from the app folder.

    Then, it will work !

    Quite boring to spend lot of hours on that, hope it will help. Don't hesitate to add it in the FAQ

  2. #2
    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: How to deal with jpeg deployment problem with Visual C++ compiler

    Quote Originally Posted by nooky59 View Post
    You should write a qt.conf file in the app folder on the target machine :

    Qt Code:
    1. [Paths]
    2. Plugins = plugins
    To copy to clipboard, switch view to plain text mode 

    If you do like above, you should place the qtjpeg4.dll in the subfolder plugins\imageformats from the app folder.
    If you don't want to use qt.conf file, you can simply put the qjpeg4.dll plugin in imageformats subdirectory.

  3. #3
    Join Date
    Nov 2007
    Posts
    53
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to deal with jpeg deployment problem with Visual C++ compiler

    No, it don't work with a program compiled with Visual C++.

    To add it directly in the imageformats subfolder, I had to put Plugins = . in the qt.conf.

    With MinGW, no problem, what you said works.

  4. #4
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to deal with jpeg deployment problem with Visual C++ compiler

    It for sure works the way jacek said. There must be an error on your side. If it won't work that way, none of my programs would work on another computer and I doubt that

  5. #5
    Join Date
    Nov 2007
    Posts
    53
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to deal with jpeg deployment problem with Visual C++ compiler

    With two advices, I couldn't resist to try again and it works ! I'm quite surprising cause I'm quite sure I have tested it with the run-time installed system-wide.

  6. #6
    Join Date
    Nov 2007
    Posts
    53
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to deal with jpeg deployment problem with Visual C++ compiler

    I have new informations about how to deal with this issue.

    If someone still want a dynamically build app with the plugin jpeg linked dynamically but without the need to install the Visual C++ runtime system-wide, you must recompile the jpeg (or other standard Qt plugin) like that :

    Qt Code:
    1. cd qt\src\plugins\imagefomats\jpeg
    2. nmake distclean
    3. qmake "CONFIG-=embed_manifest_dll"
    4. nmake
    To copy to clipboard, switch view to plain text mode 

    Et voilà ... Now, you can bundle the Visual C++ runtime locally to the app rather than systemw-ide.

    It's better cause with the system-wide approach :

    - The user can remove it without removing from the add / remove programs panel. Then it will break your app that won't start

    - You can't (at least easily) remove the system wide Visual C++ runtime when removing your app with an uninstaller without knowing if another app on the system need this system-wide runtime.

    I really don't know why TrollTech didn't add the CONFIG-=embed_manifest_dll switch per default for its standard plugins.

Similar Threads

  1. Qt configure with msvc.net
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 11th June 2007, 08:17
  2. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41

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.