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.
Re: Qt SQLCipher Driver with MSVC
It has a CMake project file.
Cheers,
_
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.
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.
Re: Qt SQLCipher Driver with MSVC
Quote:
libeay32 .a files to build
There's no such thing as a .a file in the MSVC world. Maybe you meant to say .lib?
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.