Results 1 to 3 of 3

Thread: qtsqlite build problem

  1. #1
    Join Date
    Jun 2013
    Posts
    4
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default qtsqlite build problem

    For some reason I'm getting linker errors when I try to add sqlite db to my qt project.

    qt_sqlite_linker_error.jpg

    Qt Code:
    1. #include <QApplication>
    2. #include <QtSql/QSqlDatabase>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7.  
    8. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    9. db.setDatabaseName("C:/path/to/my/sqlite/file/file.sqlite");
    10. db.open();
    11. db.close();
    12. MainWindow w;
    13. w.show();
    14. return a.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 

    I also have

    Qt Code:
    1. QT += sql
    To copy to clipboard, switch view to plain text mode 

    in my .pro file.

    Any suggestions?

  2. #2
    Join Date
    Jun 2013
    Posts
    4
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qtsqlite build problem

    Problem solved. I disabled QML debugging in project menu.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qtsqlite build problem

    Any suggestions?
    Yes, the debugging option has nothing to do with this.

    You must rerun qmake after you modify the PRO file... this was your likely problem.
    You do not need "QtSql/" in line 2 if you have "QT += sql" in the PRO file.

Similar Threads

  1. Qt 4.7.4 build problem
    By bobpo in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2011, 12:39
  2. Qt 4.7.4 build problem
    By redBeard in forum Qt Programming
    Replies: 3
    Last Post: 26th October 2011, 23:33
  3. Qt build problem...
    By antsu in forum Installation and Deployment
    Replies: 2
    Last Post: 27th September 2011, 12:06
  4. Build problem
    By poporacer in forum Newbie
    Replies: 3
    Last Post: 28th September 2010, 00:51
  5. QTSQLITE, prepared query and bindValue()
    By YaK in forum Qt Programming
    Replies: 1
    Last Post: 30th May 2009, 19:13

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.