WIN10 compiling Sqlcipher steps

Source: Internet
Author: User
Tags openssl

Preparatory work
    • Visual Studio, other versions not validated, estimated problems are not very large
    • activestate ActivePerl, for compiling OpenSSL
    • Mingw, download minimum installer installation on official website
    • MASM, assembly code operating environment, download and install the official website
    • activestate Activetcl, need to use TCLSH tool

      Please install the above software beforehand, note that some software will need to add environment variable manually after installation.

    • OpenSSL source code , download on the official website can
    • sqlcipher Source code , download on the official website can
Installing OpenSSL
    1. Administrator Privileges Open the VS2015 command-line window and use the cd /d XXX command to switch to the OpenSSL directory

    2. Execute the following command:

      • perl Configure VC-WIN32
      • nmake
      • nmake testIf the configuration is successful, the step outputs all tests successful
      • nmake installOfficial installation command, 32-bit machine installed by default on C:\Program Files (x86) \openssl folder
    3. Two library files are now generated in the installation directory:

      • Dynamic Library file Libcrypto-1_1.dll (located in the./bin directory)
      • Static library file Libcrypto.lib (located in the./lib directory)
Compiling Sqlcipher
  1. Copy the two library files generated in the previous step to the Sqlcipher home directory
  2. administrator rights to run the C:\mingw\msys\1.0\msys.bat batch file into the Msys shell command environment
  3. cd /d XXXswitch to the Sqlcipher directory with commands
  4. To modify the sqlite3.c file, add the following code at the beginning of the file:
    #define SQLITE_HAS_CODEC 1#define sqlite_enable_rtree 1#define sqlite_enable_column_metadata 1#define SQLITE_TEMP_ STORE 2
  5. Continue to modify the sqlite3.c file by adding the following code at the end of the file:
    #include <sqlcipher/crypto.c>      /*** sqlcipher addition ***/#include <sqlcipher/crypto_cc.c>      /*** SQLCIPHER addition ***/#include <sqlcipher/crypto_impl.c>/*** SQLCIPHER addition ***/#include <sqlcipher/ crypto_openssl.c>/*** SQLCIPHER addition ***/#include <sqlcipher/pager.c>       /*** SQLCIPHER addition ***/
  6. Run the following command to configure:
    ./configure--enable-tempstore=yes--with-crypto-lib=none--disable-tcl cflags= "-dsqlite_has_codec-dsqlite_ TEMP_store=2-dnocrypt-lcrypto-dsqlcipher_crypto_openssl-i/c/progra~2/openssl/include/d/mysoftware/ SQLCIPHER/SQLCIPHER-MASTER/LIBCrypto.dll-l/d/mysoftware/sqlcipher/sqlcipher-master/-STATIC-LIBGCC " ldflags= "Libcrypto.lib"
  7. Execute command:
    • make clean
    • make, generate the executable file Sqlcipher.exe
    • make dll, create a library file Sqlite3.dll

So far, the Sqlcipher source code has been compiled.

Reference articles

How to compile SQLCipher for Windows Desktop.

Compiling Sqlcipher with VS2015

I hereby thank you for quoting these two articles in writing.

WIN10 compiling Sqlcipher steps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.