在我之前的一篇文章中介绍了windows下如何使用wxsqlite3的库实现sqlite3加密。采用的方式是,直接使用wxsqlite3官方编译后的动态库或静态库。
在进行linux编译时,发现官方并未提供wxsqlite3编译后的.so或者.a。所以需要自行编译。
步骤很简单:
- clone wxsqlite到本地:https://github.com/utelle/wxsqlite3.git
- cd wxsqlite3 && cd sqlite3secure
- sqlite3secure 就是实现sqlite3加密接口的工程目录。
- 执行
$ autoreconf
$mkdir build-gtk [or any other suitable name]
$cd build-gtk
$../configure [here you should use the same flags you used to configure wxWidgets]
$make
$make install
5.编译完毕,生成的sqlite3secure.so 即为实现了加密接口的sqlite3库。在项目中可以用此库代替sqlite3!
注意:若autoreconf执行失败,自行google如何安装autoconf
总结
原本很简单的过程,问题就在于看来看去才知道sqlite3secure就是工程目录。
网友评论