Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Building QSQLCipher trouble on MacOS.
Forum Updated to NodeBB v4.3 + New Features

Building QSQLCipher trouble on MacOS.

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 945 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bogong
    wrote on 19 Mar 2019, 17:56 last edited by bogong
    #1

    Hello all!
    I am trying to build this SQLCipher plugin on Qt 5.12.2 on MacOS. Got error like this:

    $ make
    cd qsqlcipher/ && ( test -e Makefile || /Users/alexandr/Applications/Qt5.12/5.12.2/ios/bin/qmake -o Makefile /mobile_libs/qsqlcipher-qt5/qsqlcipher/qsqlcipher.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile
    Info: creating stash file /mobile_libs/qsqlcipher-qt5/build/qsqlcipher/.qmake.stash
    Project WARNING: Cross compiling without sysroot. Disabling pkg-config.
    Project WARNING: Cross compiling without sysroot. Disabling pkg-config.
    sh: --exists: command not found
    Project ERROR: sqlcipher development package not found
    make: *** [sub-qsqlcipher-make_first] Error 3
    

    The question is where to get sqlcipher development package?
    Before it I've been installing all requirements from reference.

    SQLCiher itself built via homebrew and it's working.

    *.pro

    TARGET = qsqlcipher
    
    QT_FOR_CONFIG += sqldrivers-private
    
    HEADERS += $$PWD/qsql_sqlite_p.h \
        ../../../../../../../usr/local/Cellar/sqlcipher/HEAD-162b061/include/sqlcipher/sqlite3.h \
        ../../../../../../../usr/local/Cellar/sqlcipher/HEAD-162b061/include/sqlcipher/sqlite3ext.h
    SOURCES += $$PWD/qsql_sqlite.cpp $$PWD/smain.cpp
    
    CONFIG += link_pkgconfig
    PKGCONFIG += sqlcipher
    # or if pkg-config is not available
    
    OTHER_FILES += sqlcipher.json
    
    PLUGIN_CLASS_NAME = QSQLCipherDriverPlugin
    
    # follows contents of include(../qsqldriverbase.pri)
    QT  = core core-private sql-private
    
    PLUGIN_TYPE = sqldrivers
    load(qt_plugin)
    
    DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
    
    INCLUDEPATH += $$PWD/../../../../../../../usr/include
    DEPENDPATH += $$PWD/../../../../../../../usr/include
    LIBS += -L$$PWD/../../../../../../../usr/lib/ -lcrypto.0.9.7
    
    INCLUDEPATH += $$PWD/../../../../../../../usr/local/Cellar/sqlcipher/HEAD-162b061/include
    DEPENDPATH += $$PWD/../../../../../../../usr/local/Cellar/sqlcipher/HEAD-162b061/include
    LIBS += -L$$PWD/../../../../../../../usr/local/Cellar/sqlcipher/HEAD-162b061/lib/ -lsqlcipher.0
    
    1 Reply Last reply
    0
    • B Offline
      B Offline
      bogong
      wrote on 19 Mar 2019, 18:44 last edited by
      #2

      Found another plugin QtCipherSqlitePlugin. It built perfectly (with huge list of unused var warnings). For now in my application I have this:

      QML debugging is enabled. Only use this in a safe environment.
      QSqlDatabase: SQLITECIPHER driver not loaded
      QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
      Failed to restore the database
      QSqlQuery::exec: database not open
      

      How to install this plugin? In reference for this plugin mentioned to copy it somewhere? Where should it be copied?

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bogong
        wrote on 19 Mar 2019, 19:07 last edited by
        #3

        Solved. Need to copy result of compilation to [QT_HOME]/5.12.2/clang_64/plugins/sqldrivers

        A 1 Reply Last reply 18 Oct 2020, 07:41
        0
        • B bogong
          19 Mar 2019, 19:07

          Solved. Need to copy result of compilation to [QT_HOME]/5.12.2/clang_64/plugins/sqldrivers

          A Offline
          A Offline
          Andy Pelawi
          wrote on 18 Oct 2020, 07:41 last edited by
          #4

          @bogong Thanx :)
          Whould you give me a simple code, how to use this plugin?

          1 Reply Last reply
          0
          • C Online
            C Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 18 Oct 2020, 07:44 last edited by
            #5

            @Andy-Pelawi said in Building QSQLCipher trouble on MacOS.:

            Whould you give me a simple code, how to use this plugin?

            https://doc.qt.io/qt-5/qsqldatabase.html#details

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            A 1 Reply Last reply 18 Oct 2020, 08:20
            0
            • C Christian Ehrlicher
              18 Oct 2020, 07:44

              @Andy-Pelawi said in Building QSQLCipher trouble on MacOS.:

              Whould you give me a simple code, how to use this plugin?

              https://doc.qt.io/qt-5/qsqldatabase.html#details

              A Offline
              A Offline
              Andy Pelawi
              wrote on 18 Oct 2020, 08:20 last edited by
              #6

              @Christian-Ehrlicher Thanx :)

              I testing my code using this : https://github.com/devbean/QtCipherSqlitePlugin/blob/master/testapp/main.cpp
              and success.

              And how to access the encrypted this db using a database manager like dbeaver? Do you have any suggestions?
              Sorry for my English :)

              1 Reply Last reply
              0
              • C Online
                C Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 18 Oct 2020, 10:49 last edited by
                #7

                I don't know dbeaver but since it looks like it can open all kinds of databases it should also have a plugin for sqlcipher

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved