Results 1 to 3 of 3

Thread: Driver not loaded with sqlite

  1. #1
    Join Date
    Feb 2011
    Posts
    64
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Driver not loaded with sqlite

    This question asked hundred times in the net but it seems this programmer nightmare fear. So, I have problem in loading sqlite when the program executed, I tried many thinks and I end with this:
    Main.cpp:
    Qt Code:
    1. #include <QApplication>
    2. //#include <qDebug>
    3. #include "store.h"
    4. #include <QtPlugin>
    5. #include <QCoreApplication>
    6. #include <QSqlDriverPlugin>
    7. #include <qsql_sqlite.h>
    8. #include <qsqldriver.h>
    9. #include <QPluginLoader>
    10.  
    11.  
    12. int main(int argc, char **argv)
    13. {
    14. QApplication app(argc, argv);
    15. Q_IMPORT_PLUGIN(qsqlite)
    16.  
    17. Store window;
    18. window.show();
    19. return app.exec();
    20. }
    To copy to clipboard, switch view to plain text mode 
    Store.pro:
    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3. DEPENDPATH += .
    4. INCLUDEPATH += .
    5.  
    6. # Input
    7. HEADERS += items.h store.h \
    8. sales.h \
    9. workers.h
    10. FORMS += Store.ui
    11. SOURCES += items.cpp main.cpp store.cpp \
    12. sales.cpp \
    13. workers.cpp
    14.  
    15. LIBS += -L"D:\Qt\4.7.4\plugins\sqldrivers" -lqsqlite
    16. QT += sql
    17. QTPLUGIN += qsqlite
    18. CONFIG += debug static
    To copy to clipboard, switch view to plain text mode 
    When I compile:
    Qt Code:
    1. g++ -mthreads -Wl,-subsystem,windows -o debug\Store.exe debug/items.o debug/main.o debug/store.o debug/sales.o debug/workers.o debug/moc_store.o -L"d:\Qt\4.7.4\lib" -lmingw32 -lqt
    2. maind -LD:\Qt\4.7.4\plugins\sqldrivers -lqsqlite -LD:/Qt/4.7.4/plugins/sqldrivers -lqsqlited -lQtSqld4 -lQtGuid4 -lQtCored4
    3. debug/main.o: In function `StaticqsqlitePluginInstance':
    4. C:\Documents and Settings\Administrator\Desktop\Store-dev/main.cpp:15: undefined reference to `qt_plugin_instance_qsqlite()'
    5. collect2: ld returned 1 exit status
    6. mingw32-make: *** [debug\Store.exe] Error 1
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2011
    Posts
    64
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Driver not loaded with sqlite

    After many hours of trying different configurations, I end with this:
    Qt Code:
    1. configure -release -shared -fast -qt-sql-sqlite -plugin-sql-sqlite -no-qt3support -no-dsp -no-vcproj -opensource -nomake demos -nomake examples -nomake docs -qt-libjpeg -no-openssl -no-openvg -no-style-cde -no-style-cleanlooks -no-style-plastique -no-style-motif -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-stl -no-scripttools -no-script
    To copy to clipboard, switch view to plain text mode 
    Also I removed my old dll's run time and replace it with the new one, now my application work perfectly.
    Problem solved.

  3. #3
    Join Date
    Sep 2013
    Posts
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Driver not loaded with sqlite

    Quote Originally Posted by SIFE View Post
    After many hours of trying different configurations, I end with this:
    Qt Code:
    1. configure -release -shared -fast -qt-sql-sqlite -plugin-sql-sqlite -no-qt3support -no-dsp -no-vcproj -opensource -nomake demos -nomake examples -nomake docs -qt-libjpeg -no-openssl -no-openvg -no-style-cde -no-style-cleanlooks -no-style-plastique -no-style-motif -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-stl -no-scripttools -no-script
    To copy to clipboard, switch view to plain text mode 
    Also I removed my old dll's run time and replace it with the new one, now my application work perfectly.
    Problem solved.
    Hi,

    I am trying to run the qt application in embedded linux. The application is running fine in my machine (Ubuntu 12.04) but unable to find the driver in embedded linux.

    Please help

Similar Threads

  1. QT & SQLite - driver not loaded
    By Tomasz in forum Newbie
    Replies: 5
    Last Post: 15th June 2014, 12:59
  2. Android / necessitas: SQLITE error ("Driver not loaded")
    By Al_ in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 28th August 2011, 16:06
  3. Help with QMYSQL driver for QT 4.4.0: driver not loaded
    By khikho in forum Installation and Deployment
    Replies: 4
    Last Post: 1st April 2011, 16:00
  4. run time error "driver not loaded" for sqlite.
    By netmat in forum Qt Programming
    Replies: 0
    Last Post: 2nd August 2010, 06:42
  5. SQlite driver not loaded error
    By ibergmark in forum Installation and Deployment
    Replies: 2
    Last Post: 17th March 2008, 02:09

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.