Results 1 to 6 of 6

Thread: SQLite driver unavailable

  1. #1
    Join Date
    Jan 2006
    Posts
    46
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default SQLite driver unavailable

    Hi guys, I have a new problem.
    I'm trying to open a SQLite database but, when I do addDatabase("QSQLITE") I got this error:
    leonardo@niquel:~/svn/testqt4/bin$ ./testqt4
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers:
    The driver is compiled as a plugin and exists in sqldrivers directory
    leonardo@niquel:~/svn/testqt4/bin$ ls /usr/local/qt421/plugins/sqldrivers/
    libqsqlite.a libqsqlmysql.a libqsqlodbc.a
    What am I doing wrong again?
    I've been looking the examples, but every show just the QSqlDatabase::addDatabase("QSQLITE") sentence, but I don't know what to do if the driver is not loaded.

    Thanx a lot in advance.
    Kandalf
    There's no place like ~

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: SQLite driver unavailable

    Are you sure these are plugins (what OS do you use? For example under Linux plugins should have a "so" extension)? Did you compile Qt statically? You can't use plugins with a static build of Qt.

  3. #3
    Join Date
    Jan 2006
    Posts
    46
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: SQLite driver unavailable

    Thanks Wysota, I have compiled statically under linux. I will recompile it since, at home, I have compiled it dinamicaly and the plugin works just fine.

    Cheers.
    Kandalf
    There's no place like ~

  4. #4
    Join Date
    Jan 2006
    Posts
    46
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: SQLite driver unavailable

    The problem was solved recompiling Qt with shared libraries.
    Kandalf
    There's no place like ~

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: SQLite driver unavailable

    You can also compile Qt statically and have the sql driver available but you have to compile the support directly into Qt libraries. See configure -help for details.

  6. #6
    Join Date
    Feb 2009
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: SQLite driver unavailable

    Quote Originally Posted by wysota View Post
    You can also compile Qt statically and have the sql driver available but you have to compile the support directly into Qt libraries. See configure -help for details.
    did you mean ./configure -static -qt-sql-sqlite ?

    Edit :
    i have configured with this ./configure -static -qt-sql-sqlite and it works.
    Last edited by burakozturk; 11th February 2009 at 18:08.

Similar Threads

  1. Bulk insert into SQLite
    By munna in forum Qt Programming
    Replies: 6
    Last Post: 19th November 2007, 04:56
  2. MySql plugin driver issues
    By stevey in forum Installation and Deployment
    Replies: 11
    Last Post: 20th September 2006, 14:45

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.