Hi there. I know that this topic has been brought up dozen of times, but I am still having trouble. I need to distribute my application to another computer. And I want to have JPEG support.

here .pro file:

Qt Code:
  1. CONFIG += static
  2. TARGET = QKml
  3. QTPLUGIN+= qjpeg
  4. TEMPLATE = app
  5. SOURCES += main.cpp \
  6. mainwindow.cpp \
  7. kml.cpp \
  8. Geodesic.cpp \
  9. JPG.cpp
  10. HEADERS += mainwindow.h \
  11. kml.h \
  12. Geodesic.hpp \
  13. Constants.hpp \
  14. JPG.h
  15. FORMS += mainwindow.ui
To copy to clipboard, switch view to plain text mode 

Here my main.cpp file:
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "mainwindow.h"
  3.  
  4. #include <QtPlugin>
  5.  
  6. Q_IMPORT_PLUGIN(qjpeg)
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10. QTextCodec::setCodecForCStrings(QTextCodec::codecForName("Windows-1251"));
  11.  
  12. QStringList list_path;
  13. QDir dir = QDir(qApp->applicationDirPath()+"/plugins/");
  14. list_path << dir.absolutePath () << qApp->libraryPaths ();
  15. qApp->setLibraryPaths( list_path );
  16.  
  17. QApplication a(argc, argv);
  18. a.setLibraryPaths(list_path);
  19. MainWindow w;
  20. w.show();
  21. return a.exec();
  22. }
To copy to clipboard, switch view to plain text mode 
I'm trying to compile it as "release".
And it doesn't want to be compiled. The error is: "collect2: ld returned 1 exit status". In release folder where .exe is located I have "imageformats" folder with dlls and ".a" files. Can somebody help? Thank you so much in advance.