PDA

View Full Version : Qt SQLCipher Driver with MSVC



Palsy
17th December 2016, 01:29
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.

anda_skoa
17th December 2016, 10:35
It has a CMake (https://cmake.org/) project file.

Cheers,
_

d_stranz
17th December 2016, 16:24
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 (https://cmake.org/cmake/help/v3.3/manual/cmake-generators.7.html#manual:cmake-generators(7)) 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.

Palsy
28th December 2016, 01:56
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.

d_stranz
28th December 2016, 02:48
libeay32 .a files to build

There's no such thing as a .a file in the MSVC world. Maybe you meant to say .lib?

Palsy
28th December 2016, 03:05
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.