I am following this tutorial for compiling SQLite with SQLCipher on Windows. I am confused about pre-requisites for compilation. I found that I need to install following to compile it:
Among all above, I just have Visual Studio 2008 installed. I am working on Windows 7.
What are exact pre-requisites for compiling SQLite with SQLCipher on Windows?
It seems that SQLCipher is distributed as a checkout of SQLite sources + modifications, judging by a quick look - and that being the multi-file version rather than the "amalgation". Thus, you need an environment capable of building SQLite sources, which means a bunch of unixy apps.
Personally, I'd do a diff between the SQLCipher source archives and the SQLite version it includes (which seems to be SQLite 3.7.2 for SQLCipher 1.8.2, judging by the VERSION file) - this should give an idea which modifications, if any, are done to the source SQLite files, as well as list files particular to SQLCipher.
To avoid hassles with building OpenSSL manually, you can grab prebuilt versions, which rids you of the Perl dependencies (iirc OpenSSL builds fine with Visual C++, so MingW shouldn't be a dependency).
If the SQLCipher author hasn't purposefully made the job of separating his specific code parts from SQLite tricky (which he might have, to cash in some money from selling win32 binaries), you'd be able to take his changes and combine with a SQLite amalgation version and prebuilt OpenSSL binaries, which should make for a really easy drop-in in a Visual Studio solution.
Of course it means you'll have to go through the extraction step if you want to upgrade to a newer version of SQLCipher, but it'd probably be worth it, unless you really want to install a cygwin development environment just to be able to build this single library.
Alternatively, you might be able to do the configure step of SQLCipher on a *u*x box (whether that being linux, *BSD or a Mac OS X shell), since the compile step shouldn't require all the funky tools.
I checked out (version 3.7.2)[http://www.sqlite.org/src/info/42537b6056] of SQLite and ran a diff against the SQLCipher 1.1.8 distribution, and it seems like a pretty reasonable task to extract the modified portions:
Makefile.in - references added for the new crypto files. tool/mksqlite3c.tcl: references added for the new crypto files. src/pragma.c - one added block, marked /** BEGIN_CRYPTO **/ src/pager.c - one added block, marked /** BEGIN_CRYPTO **/ src/crypto.h - new file. src/crypto.c - new file.
Also, it seems pretty overkill to take a dependency on OpenSSL just to get AES crypto support - building something new based on SQLCipher to use a dedicated (and much smaller) AES package would be nicer.
The minimal setup you need to compile SQLCipher on windows is:
Using the steps in the thread, you can create the DLLs directly or generate an amalgamation to include in your project.
If you want to save all those steps and time, for a small charge you can also get precompiled SQLCipher windows binaries from the website at http://sqlcipher.net/downloads. These binary sales are mutually beneficial since they can help you get working more quickly, and they help support the project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With