SqlCipher Build on Windows

I just finished going through the process of building OpenSSL 1.1.1g and SqlCipher from the 4.4.0 branch, on Windows 10 and Visual Studio 2019 Community Edition, with the current Windows SDK. I ran into multiple what turned out to be small issues. But at the end all seems to be working in initial tests.

The info I could find for building on Windows was mostly outdated or incorrect in a variety of blog posts and other stuff I found. Does anyone think there would be interest in me writing up the build process for both OpenSSL and for SqlCipher 4.4.0 in the above environment? If so, I’m open to suggestions on where to publish, what to publish, etc.

Also I think I hit at least two small bugs in the Makefile.msc for Windows that I could file an issue for, if that is worthwhile to anyone. If this is worth posting an issue, I’d be willing to do that and to make the related pull request for a possible fix.

Thanks in advance for any info/reactions :slight_smile:

2 Likes

Hello @skolson5903, Thanks for trying out SQLCipher! Due to the very wide variety of configuration and build options for Windows, we don’t provide build instructions or public support for compilation on that platform on our sites. We only directly support the official Commercial Edition packages we distribute .

That said, you are still certainly welcome to build things on your own under the Community Edition license, and of course to publish any documentation you come up with. If you do, since these would be third-party build instructions, we would suggest posting it on your own website or blog. This way it is clear that they reflect your results and requirements, etc. It will also make it easier for you to keep things updated as things inevitably change, and for people to contact you directly if they have questions or need support.

Finally, with respect to changes in Makefile.msc, we’d need to review the proposed changes to determine whether we could accept them. Makefile.msc is based on the upstream SQLite project. As a general rule, we don’t accept changes to “shared” files that would make them materially different than the upstream baseline. If a change is generally applicable to SQLite and not just SQLCipher, the change must first be submitted upstream to the SQLite project. After it is incorporated into SQLite as part of an official release we would bring it down into SQLCipher via our standard release process. If you are interested in providing patches or improvements to SQLCipher itself the project contributor agreement is also a prerequisite.

Thanks for using SQLCipher and let us know if you have any questions!

@skolson5903 I found your post to build SqlCipher in the latest VS 2019 CE. I would be really interested in a write-up or pointed in the right direction to how to build.

I found a few stackoverflow and some old python pip stuff but it’s like 4 years old. I’m looking to build and use in Python on Win10 64-bit. Any help on how to get started would be appreciated.

I’m sure even if you did the write-up on this thread it would become a popular thread :slight_smile:

Thanks!

A write-up on how to build sqlcipher on windows with latest setup environment is definitely a welcome effort. I myself spend days reading through many guides on the net only to find out most of the information is outdated.

A full guide on how to build and install as well as doing extensions for further development (e.g how to then create modules for python for example) will be great.

Cool! As an update, over the last couple weeks I dove into writing a Gradle plugin that can download and build openssl and sqlcipher for all the 64 bit platforms I needed. That includes vstudio, mingw, x86_64 and arm64 android, and linuxX64. I’m gonna do IOS later. It now works enuff on both windows and linux build systems to be an alpha release, and I’m gonna put it up on GitHub probably tomorrow, and then publish the plugin to the Gradle plugin repo. The readme on the GitHub repo has a lot of info even if you aren’t a gradle user. I don’t know if either of you are gradle users, but either way it may be useful. I’ll post here again tomorrow with a link to the GitHub repo. Let me know if there is stuff missing in it that you want to see, I learned a lot doing it and lots is not documented yet. If you are gradle users I’d love suggestions for improvement…

1 Like

I got some extra time today, so the Github repo is up as of a few minutes ago: Gradle Plugin. If you are not a Gradle user, see the README on the home page, especially the Windows related notes towards the end. If you are a gradle user, I still hope to figure out how to publish this to the gradle plugin repo, but I am a newbie at that so will likely struggle :slight_smile:

1 Like

Excellent!. Though I’m not that familiar with gradle… it is at least a step further to provide a consistent and up to date build documentation. Investing my time to learn gradle to understand you code build automation will be worthwhile.

Thank you @skolson5903 for you effort.

If you have a JDK, after doing the standalone gradle install it’s easy to run from a command line. Gradle is a pretty cool build automation system, and I’m only using a small slice of what it can do. I use it almost for everything I do in Android Studio and IntelliJ IDEA. Even if you don’t want to use Gradle in the long run, getting one build to run will produce the support scripts it uses, which you can than use/modify/keep for future ref. They all start with the prefix “Plugin-” and are built in the respective openssl and sqlcipher src libs. The verify tasks will also ensure you have everything you need installed.