PDA

View Full Version : Static compile and SQL



Alan_K
8th May 2012, 16:42
Hi all. I have problem with my application. I built static application like in this video-tutorial (http://www.youtube.com/watch?v=chMNUzpN4pw), but suddenly SQL support in my application stopped working. I don't have any ideas what happened bad. Maybe I must compile that again with another parameters? If so, then what?

My *.pro file, is this good?


QT += core gui sql

CONFIG += libqsqlmysql4
CONFIG += libqsqlmysqld4
CONFIG += static

TARGET = game-launcher
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp \
login.cpp

HEADERS += mainwindow.h \
login.h

FORMS += mainwindow.ui \
login.ui

RESOURCES += \
zasoby.qrc

RC_FILE = settings.cfg


Sorry for my bad english. :rolleyes:

ChrisW67
8th May 2012, 23:35
Qt SQL functionality is implemented using plugins. Statically linked Qt cannot use dynamically loaded plugins so any require plugins must be built-in and explicitly loaded.
Static Plugins

Lines 3 and 4 of your PRO file don't make much sense.
You are missing the QTPLUGIN variable
You are probably missing the Q_IMPORT_PLUGIN() macro in your code

You will still need to deploy any database engine library your SQL support requires.