Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt 5.4 - Mac OS X - QSqlDatabase: SQLITE driver not loaded



  • Hi,
    i have problems starting my application out of my app bundle.
    @
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
    couldn't connect to database Error[ "Driver not loaded Driver not loaded" ]
    @

    otool -L gives:
    @
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1151.16.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57031.1.34)
    @executable_path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.4.0, current version 5.4.0)
    /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    @executable_path/../Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtWebEngine.framework/Versions/5/QtWebEngine (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtSql.framework/Versions/5/QtSql (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtXmlPatterns.framework/Versions/5/QtXmlPatterns (compatibility version 5.4.0, current version 5.4.0)
    @executable_path/../Frameworks/QtXml.framework/Versions/5/QtXml (compatibility version 5.4.0, current version 5.4.0)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
    @

    Any ideas whats missing?
    I had a similar problem some days before when using QMYSQL but there was the problem that the libmsql... was missing.

    otool -L on libqsqlite.dylib:
    @
    libqsqlite.dylib (compatibility version 0.0.0, current version 0.0.0)
    /development/Qt/5.4.0-beta/5.4/clang_64/lib/QtSql.framework/Versions/5/QtSql (compatibility version 5.4.0, current version 5.4.0)
    /development/Qt/5.4.0-beta/5.4/clang_64/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.4.0, current version 5.4.0)
    /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
    @

    I think the problem is that here somehow it is referenced to
    @
    /development/Qt/5.4.0-beta/5.4/clang_64/lib/QtSql.framework/Versions/5/QtSql (compatibility version 5.4.0, current version 5.4.0)
    @

    instead to
    @
    executable_path/../Frameworks/QtSql.framework/Versions/5/QtSql
    @
    like in the binary.

    I don't know how to tell libqsqlite.dylib to use the Qt from Framework inside my app bundle?

    Any ideas?

    Greetings
    Nando


Log in to reply