Results 1 to 6 of 6

Thread: Statically linked QtSql modules

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Posts
    26
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Statically linked QtSql modules

    I'm going to ask my question here.
    I have rebuilt Qt with the -static option passed to the configure script.

    And then run qmake on my project and started to recompile. It compile good and it runs. But the problem is when I try to connect my app to SQLite database.
    I get two messages:
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers:

    And this is how I construct it:
    Qt Code:
    1. QSqlDatabase DB = QSqlDatabase::addDatabase(driver);
    2. DB.setDatabaseName(QString(QDir::homePath()+"/.ma/%1").arg(dbName));
    To copy to clipboard, switch view to plain text mode 
    It worked like a charm before I didn't have compiled Qt with the -static option.
    I am including the QtSql in the app.
    And Qt version is 4.3.1 OpenSource

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Statically linked QtSql modules

    Try adding Q_IMPORT_PLUGIN(qsqlite) to your sources and QTPLUGIN += qsqlite to your .pro file.

    http://doc.trolltech.com/4.2/plugins...static-plugins

Similar Threads

  1. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52
  2. statically linked executable
    By smalls in forum Qt Programming
    Replies: 8
    Last Post: 11th February 2006, 02:09

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
  •  
Qt is a trademark of The Qt Company.