Static build for SQL plugin
-
You won't have any plugin lib since they are built in Qt's sql library, did you add qsqlpsql in your pro file ?
-
[quote author="SGaist" date="1380487767"]You won't have any plugin lib since they are built in Qt's sql library, did you add qsqlpsql in your pro file ?[/quote]
test.pro
[code]QT += core gui sqlgreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test
TEMPLATE = appSOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui
QTPLUGIN += qsqlpsql
QMAKE_LFLAGS += -static -static-libgcc -static-libstdc++ -lpthread
LIBS += -LC:/postgresql-9.1.9/src/interfaces/libpq -lpq
[/code] -
main.cpp
[code]#include "mainwindow.h"
#include <QApplication>
#include <QtPlugin>Q_IMPORT_PLUGIN( qsqlpsql )
int main(int argc, char *argv[])
{QApplication a(argc, argv); MainWindow w; w.show(); return a.exec();
}
[/code] -
Just thought that since you have all sql plugins built in you might not need the QTPLUGIN line from the pro file
-
[quote author="SGaist" date="1380528900"]Just thought that since you have all sql plugins built in you might not need the QTPLUGIN line from the pro file[/quote]
Unfortunately it didn't fix the issue and generated ton of errors as shown in full log of build process: http://paste.kde.org/p96ac01e7
I'm really frustrated; The hardest step done (building Postgresql with MinGW) while the supposed easy one delays the success!!!
-
Looks like it needs postgresql symbol, you have to add the link information to postgresql
-
[quote author="SGaist" date="1380785713"]Looks like it needs postgresql symbol, you have to add the link information to postgresql[/quote]
How can I do it?
-
Add the same -l and -L to LIBS that you used to build Qt with postgresql
-
[quote author="SGaist" date="1380805190"]Add the same -l and -L to LIBS that you used to build Qt with postgresql[/quote]
I already added them as mentioned in "a reply before":https://qt-project.org/forums/viewreply/144622/.
-
Is there any new idea guys? The recent result I got was:
https://qt-project.org/forums/viewreply/144622/
https://qt-project.org/forums/viewreply/144623/