Results 1 to 6 of 6

Thread: Qt SQLCipher Driver with MSVC

  1. #1
    Join Date
    Dec 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Qt SQLCipher Driver with MSVC

    Hi,

    I am using Sqlite for my database and plan to use SQLCipher for encryption with QT5.

    I am having issues however, trying to create the dll drivers for MSVC (Mingw not an option for me at the moment as I use Visual Studio rather than QT).

    Can anybody help or explain in clearer steps what I need to do to get this working?

    There is this: https://github.com/sijk/qt5-sqlcipher but this does not have a project file so I'm a bit confused how to correct configure the library to create the plugin.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt SQLCipher Driver with MSVC

    It has a CMake project file.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,117
    Thanks
    235
    Thanked 656 Times in 646 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Qt SQLCipher Driver with MSVC

    To expand a bit:

    - Download and install CMake. Check the CMakelists.txt file to see the minimum CMake version required for the project. The current CMake 3.x will probably be fine.

    - You probably want to do a build outside of the source tree, so make a directory where the MSVC project will be generated.

    - Open a Visual Studio DOS command window and CD to that directory.

    - Run the command: cmake -G"NMake Makefiles" <path to root of SQLCipher source tree>
    (where of course you substitute the actual path for "<path to ...>")

    - The previous step generates NMake Makefiles. If you want to generate a Visual Studio "solution" instead, use "Visual Studio 14 2015" instead of "NMake Makefiles". Note it is case-sensitive. See the CMake documentation for more options.

    - If you generated Makefiles, the next step is to build your project: "cmake --build ." Otherwise, open the solution in VS and build it there.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  4. #4
    Join Date
    Dec 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Qt SQLCipher Driver with MSVC

    Thanks for this. After stressing and much trial and error over a week, I did manage to get it building and find out what the remaining issue I had was.

    Basically the issue I am having now is getting the OpenSSL libeay32 .a files to build, when I've compiled OpenSSL it didn't generate all the files needed for me to complete the build. So I had a DLL plugin building, which didn't work completely at all.

    In the end I've opted for a different SQLite encryption alternative. So got to where I wanted in the end, just different means to the end.

    I may go back to the SQLCipher project itself and see if I can sort it at another point with 5.7, if I'm unhappy with this alternative I've found.

    Thanks to you all for your help, learnt a lot in the process, even if it didn't quite solve the issues for me.

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,117
    Thanks
    235
    Thanked 656 Times in 646 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Qt SQLCipher Driver with MSVC

    libeay32 .a files to build
    There's no such thing as a .a file in the MSVC world. Maybe you meant to say .lib?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  6. #6
    Join Date
    Dec 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Qt SQLCipher Driver with MSVC

    Yep, and it built that. The project file contained libs for .a (linux), .lib, and I think one other (using a template instructions I found, which were for MinGW).

    In any case I built it with the .lib as well, but came across linker issues. Would I need to include the .def as well?

    I wasn't sure if the other files / something was missing preventing it from working. The dll was building to a size of 10kb, so obviously wasn't right.

    This is all a few days ago now and since moving on, I haven't kept a proper record of what steps I took, so apologies for any confusion.

    As I say, I'll probably revisit the .pro file another time. Less of a priority for now as I have something else, but would be good if I can solve it and document it for anybody else looking for a guide to installing a plugin for it.

Similar Threads

  1. Problem using the SqlCipher Driver
    By doublebyte in forum Qt Programming
    Replies: 2
    Last Post: 22nd February 2016, 08:26
  2. Trying to build Qt-SQL-driver-plugin for SQLite-DB with SQLCipher-extension
    By breakthecode in forum Installation and Deployment
    Replies: 1
    Last Post: 26th July 2015, 09:24
  3. [Qt 5.2 msvc x64] QMYSQL invalid driver handle
    By konserw in forum Qt Programming
    Replies: 0
    Last Post: 27th December 2013, 15:11
  4. MySql driver compile problem (QtSDK/QtSources 4.8.1 and msvc 2010)
    By junhonguk in forum Installation and Deployment
    Replies: 1
    Last Post: 22nd April 2013, 03:57
  5. Replies: 1
    Last Post: 21st September 2010, 08:58

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.