Astrologer
26th April 2010, 13:48
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:
CONFIG += static
TARGET = QKml
QTPLUGIN+= qjpeg
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp \
kml.cpp \
Geodesic.cpp \
JPG.cpp
HEADERS += mainwindow.h \
kml.h \
Geodesic.hpp \
Constants.hpp \
JPG.h
FORMS += mainwindow.ui
Here my main.cpp file:
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QtPlugin>
Q_IMPORT_PLUGIN(qjpeg)
int main(int argc, char *argv[])
{
QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("Windows-1251"));
QStringList list_path;
QDir dir = QDir(qApp->applicationDirPath()+"/plugins/");
list_path << dir.absolutePath () << qApp->libraryPaths ();
qApp->setLibraryPaths( list_path );
QApplication a(argc, argv);
a.setLibraryPaths(list_path);
MainWindow w;
w.show();
return a.exec();
}
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.
here .pro file:
CONFIG += static
TARGET = QKml
QTPLUGIN+= qjpeg
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp \
kml.cpp \
Geodesic.cpp \
JPG.cpp
HEADERS += mainwindow.h \
kml.h \
Geodesic.hpp \
Constants.hpp \
JPG.h
FORMS += mainwindow.ui
Here my main.cpp file:
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QtPlugin>
Q_IMPORT_PLUGIN(qjpeg)
int main(int argc, char *argv[])
{
QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("Windows-1251"));
QStringList list_path;
QDir dir = QDir(qApp->applicationDirPath()+"/plugins/");
list_path << dir.absolutePath () << qApp->libraryPaths ();
qApp->setLibraryPaths( list_path );
QApplication a(argc, argv);
a.setLibraryPaths(list_path);
MainWindow w;
w.show();
return a.exec();
}
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.