Results 1 to 6 of 6

Thread: Statically linked QtSql modules

  1. #1

    Default Statically linked QtSql modules

    Is there a way to build the QtSql plugins as separate static libs, or must the entire Qt library be rebuilt with the plugins compiled into the monolithic library?

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Statically linked QtSql modules

    Quote Originally Posted by runderwo View Post
    Is there a way to build the QtSql plugins as separate static libs, or must the entire Qt library be rebuilt with the plugins compiled into the monolithic library?

    Depend how or which sql you use....
    Firebird, Sqlite3 can build static... other depend from external Libs
    Example MYSQL must have external dll or lib odbcunix or window is same....

    Or you can build static an installer to but dll or libs on right place....

  3. #3

    Default Re: Statically linked QtSql modules

    I would like to build a separate static lib for the Sqlite plugin, so I can just link the SQL driver lib into my project. This way I avoid having to maintain an entirely custom compiled static Qt library in the repository.

  4. #4
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Statically linked QtSql modules

    Quote Originally Posted by runderwo View Post
    I would like to build a separate static lib for the Sqlite plugin, so I can just link the SQL driver lib into my project. This way I avoid having to maintain an entirely custom compiled static Qt library in the repository.
    If you can grab code on subversion have a look on code:

    http://sourceforge.net/projects/qtexcel-xslt/

    is a excel "emulator" wo work on sqlite3 and convert in many other format....

    is build on qt4.1 ... but i tested && you can build to on qt4.3 beta

    on folder /static_sqlite_table/

    otherwise you must write your own lib....

    if you like to run on qt3 have a look on sqlitebrowser on sf.net

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

    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

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

    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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.