Results 1 to 4 of 4

Thread: QSQLCIPHER driver not loaded

  1. #1
    Join Date
    May 2014
    Posts
    5
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default QSQLCIPHER driver not loaded

    I have built QSQLCIPHER drivers. It produced 4 files.i.e. qsqlcipher.dll(761kb), qsqlcipherd.dll(3619kb),qsqlcipher.a(3kb), qsqlcipherd.a(3kb). I am using Qt 5.3.0 on windows. I put the two qsqlcipher dll files in C:\Qt\Qt5.3.0\5.3\mingw482_32\plugins\sqldrivers folder. If I try to view available database drivers using the following code QSQLCIPHER driver is not shown up.

    qDebug()<<QSqlDatabase::drivers();

  2. #2
    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: QSQLCIPHER driver not loaded

    If you have dynamically linked against the OpenSSL library when building SqlCipher then you will need to ensure the required OpenSSL Dlls are on the system path or in the same folder as the plugin.

  3. #3
    Join Date
    May 2014
    Posts
    5
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QSQLCIPHER driver not loaded

    Let me explain the steps that I followedsqlcipher is in c:\sqlcipher)

    1)./configure --with-crypto-lib=none --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/openssl-win32/include /c/sqlcipher/libeay32.dll -L/c/sqlcipher/ " LDFLAGS="-leay32"

    2) make clean
    3) make sqlite3.c
    4) make
    5) make dll

    sqlcipher.pro file

    TARGET = qsqlcipher

    HEADERS = C:/Qt/Qt5.3.0/5.3/Src/qtbase/src/sql/drivers/sqlite/qsql_sqlite_p.h
    SOURCES = smain.cpp \
    C:/Qt/Qt5.3.0/5.3/Src/qtbase/src/sql/drivers/sqlite/qsql_sqlite.cpp

    !system-sqlite:!contains( LIBS, .*sqlite3.* ) {
    CONFIG(release, debug|release)EFINES *= NDEBUG
    DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE SQLITE_HAS_CODEC
    INCLUDEPATH += include
    INCLUDEPATH +=c:/sqlcipher
    LIBS += -Ic:/sqlcipher -Ic:/OpenSSL-Win32/include c:/sqlcipher/libsqlite3.dll c:/openssl-win32/libeay32.dll

    } else {
    LIBS *= $$QT_LFLAGS_SQLITE
    QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
    }

    include(../qsqldriverbase.pri)

    smain.cpp file:

    #include <qsqldriverplugin.h>
    #include <qstringlist.h>
    #include "../../../qtbase/src/sql/drivers/sqlite/qsql_sqlite_p.h"

    QT_BEGIN_NAMESPACE

    class QSQLCipherDriverPlugin : public QSqlDriverPlugin
    {
    Q_OBJECT
    Q_PLUGIN_METADATA(
    IID "org.qt-project.Qt.QSqlDriverFactoryInterface" FILE "sqlcipher.json")

    public:
    QSQLCipherDriverPlugin();

    QSqlDriver *create(const QString&);
    QStringList keys() const;
    };

    QSQLCipherDriverPlugin::QSQLCipherDriverPlugin()
    : QSqlDriverPlugin()
    {
    }


    QSqlDriver *QSQLCipherDriverPlugin::create(const QString& name)
    {
    if (name == QLatin1String("QSQLCIPHER"))
    {
    QSQLiteDriver *driver = new QSQLiteDriver();
    return driver;
    }
    return 0;
    }


    QStringList QSQLCipherDriverPlugin::keys() const
    {
    QStringList l;

    l << QLatin1String("QSQLCIPHER");
    return l;
    }


    QT_END_NAMESPACE

    #include "smain.moc"

    What am I missing ?

  4. #4
    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: QSQLCIPHER driver not loaded

    1. You have built SqlCipher to dynamically link with the OpenSSL library libeay32. This DLL needs to be available at run time for the plugin to be able to load.
    2. Your configure command is a bit of a mess but probably not the cause of a failure to load. I would have expected something like:
    Qt Code:
    1. ./configure --disable-tcl \
    2. CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/openssl-win32/include" \
    3. LDFLAGS="-L/c/openssl-win32/lib -leay32"
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. App found qsqlite4.dll driver file but still "Driver not loaded"
    By merelendor in forum Installation and Deployment
    Replies: 2
    Last Post: 17th August 2011, 11:15
  2. Help with QMYSQL driver for QT 4.4.0: driver not loaded
    By khikho in forum Installation and Deployment
    Replies: 4
    Last Post: 1st April 2011, 15:00
  3. Replies: 1
    Last Post: 24th April 2010, 03:43
  4. Driver not loaded
    By wirasto in forum Qt Programming
    Replies: 0
    Last Post: 23rd November 2009, 06:08
  5. Driver not loaded
    By rogerio in forum Installation and Deployment
    Replies: 8
    Last Post: 16th May 2009, 07:07

Tags for this Thread

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.