How to build sqlcipher (ver 3.4.1) for windows

用到的工具有(The minimal setup you need to compile SQLCipher on windows is:)


OpenSSL, either in source or binary
forms Perl - Optional, only required if you build OpenSSL
MinGW / MSYS - required to configure SQLCipher
Tcl - required by the SQLite build system to build the amalgamation code
Visual Studio - to build your project


sqlcipher依赖openssl(我用的是openssl 1.1.0f,注意sqlcipher支持的openssl版本,在CHANGELOG.md中可以看到),
编译openssl需要安装Perl(推荐ActivePerl 5.24.1 Build 2402, 64Bit版)。


编译OpenSSL(可以参考代码包里的编译说明):

perl Configure VC-WIN32 --prefix=C:\opensslbuild32
nmake
nmake test
nmake install


编译完后将libcrypto-xxx.dll拷贝到sqlcipher的目录下,并将名字改为libcrypto.dll,在配置sqlcipher时会用到。


配置和编译sqlcipher
------------------------
./configure --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/opensslbuild32/include /c/sqlcipher/libcrypto.dll -L/c/sqlcipher -static-libgcc" LDFLAGS="-lcrypto"
make clean
make sqlite3.c
make


参考链接:
https://stackoverflow.com/questions/4353037/compile-sqlite-with-sqlcipher-on-windows

https://discuss.zetetic.net/t/declaration-error-during-sqlcipher-build-on-windows-7/1838


编译成功后,会在sqlcipher的字目录.libs下生成libsqlcipher-0.dll

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值