PDA

View Full Version : Static link SQLITE to executable



RolandHughes
14th March 2011, 04:07
I'm doing my best to force Qt to static link SQLite into the executable I'm building using Eclipse and the Qt development plug-in.

I am on KUbuntu 10.10 64-bit AMD and have rebuilt from source the Qt libraries using -qt-sql-sqlite to force the sqlite plug-in to be static inside of the Qt libraries. I even renamed the stale plug-in which was out in the plugins directory so I'm absolutely certain the plugin isn't being called. Here is my .PRO


TEMPLATE = app
TARGET = xpnsqtsql
QT += core \
gui \
sql
HEADERS += XpnsBrowseWindow.h \
YNValidator.h \
categoryDialog.h \
payeeDialog.h \
ReportBrowserDialog.h \
SplashDialog.h \
TaxYearDialog.h \
XpnsLogonDialog.h \
xpnsform.h
SOURCES += categoryDialog.cpp \
payeeDialog.cpp \
XpnsBrowseWindow.cpp \
ReportBrowserDialog.cpp \
SplashDialog.cpp \
TaxYearDialog.cpp \
XpnsLogonDialog.cpp \
main.cpp \
xpnsform.cpp
FORMS += CategoryDialog.ui \
PayeeDialog.ui \
ReportBrowserDialog.ui \
SplashDialog.ui \
TaxYearDialog.ui \
XpnsLogonDialog.ui \
xpnsform.ui
RESOURCES +=
LIBS += -L/usr/lib/libsqlite3.a


I have tried every possible thing I could think of with LIBS, but no matter what, I see this on the link

g++ -m64 -o xpnsqtsql debug/categoryDialog.o debug/payeeDialog.o debug/XpnsBrowseWindow.o debug/ReportBrowserDialog.o debug/SplashDialog.o debug/TaxYearDialog.o debug/XpnsLogonDialog.o debug/main.o debug/xpnsform.o debug/moc_XpnsBrowseWindow.o debug/moc_categoryDialog.o debug/moc_payeeDialog.o debug/moc_ReportBrowserDialog.o debug/moc_SplashDialog.o debug/moc_TaxYearDialog.o debug/moc_XpnsLogonDialog.o debug/moc_xpnsform.o -L/usr/lib -L/usr/lib/libsqlite3.a -lQtSql -L/usr/lib -lsqlite3 -lQtGui -L/usr/X11R6/lib64 -lQtDBus -lQtXml -lQtCore -lfontconfig -lpthread
make[1]: Leaving directory `/home/roland/workspace/xpnsqtsql'

Yes, my static library is linked in front of the dynamic, but I would like a way to _only_ link the static lib.

Is there something obvious that I'm missing?