PDA

View Full Version : How to deploy the imageviewer example in windows?



fork
11th March 2010, 10:03
I am new to QT and trying to play with the examples first. I am able to run the Imageviewer example on my windows and can view any image files. The example is here: http://qt.nokia.com/doc/4.6/widgets-imageviewer.html

Then, I try to deploy a release to another windows machine without QT installed. I included MINGWM10.DLL LIBGCC_S_DW2-1.DLL QTCORE4.DLL QTGUI4.DLL in the same folder of the imageviewer.exe. The program starts ok. But I cannot open any image file. It just says " cannot load xxx.jpg"

What will be the problem? Do I need to include any DLL files for jpeg library? Which DLL should I include?

Thanks

yogeshgokul
11th March 2010, 10:10
I am new to QT and trying to play with the examples first. I am able to run the Imageviewer example on my windows and can view any image files. The example is here: http://qt.nokia.com/doc/4.6/widgets-imageviewer.html

Then, I try to deploy a release to another windows machine without QT installed. I included MINGWM10.DLL LIBGCC_S_DW2-1.DLL QTCORE4.DLL QTGUI4.DLL in the same folder of the imageviewer.exe. The program starts ok. But I cannot open any image file. It just says " cannot load xxx.jpg"

What will be the problem? Do I need to include any DLL files for jpeg library? Which DLL should I include?

Thanks

Additionally you need to deply a image format dll alongwith. You can find them in \qt\plugins\imageformats\*

fork
11th March 2010, 10:30
thanks yogeshgokul.
I just tried. I put all dll files I found in the \qt\plugins\imageformats\ in the same directory of the exe file. It still does not work. :(
Is loading plugins different from loading libraries?

yogeshgokul
11th March 2010, 10:43
thanks yogeshgokul.
I just tried. I put all dll files I found in the \qt\plugins\imageformats\ in the same directory of the exe file. It still does not work. :(
Is loading plugins different from loading libraries?

You need to call a function.

QApplication app(...);
app.addLibraryPath(app.applicationDirPath());

fork
11th March 2010, 10:52
I finally got it working. I put all image related DLL files in imageformats/ folder.