SQLite 3.7.13的加密解密(二)—— 开放宏定义

本文详细介绍了如何在SQLite3.7.13中配置加密解密功能,并解决了在实现过程中遇到的编译错误。通过添加特定宏定义并进行错误排查,最终成功实现了加密解密功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

SQLite 3.7.13的加密解密(二)—— 开放宏定义
原创作品,允许转载,转载时请务必以超链接形式标明文章  原始出处 、作者信息和本声明。否则将追究法律责任。 http://lancelot.blog.51cto.com/393579/940808

首先要在sqlite3.c中最前面,添加代码(网上有说在sqlite3.h中添加也可,实际测试在sqlite3.h中打开该宏是无效的):

#ifndef SQLITE_HAS_CODEC

#define SQLITE_HAS_CODEC

#endif

 

这个宏是用来确定是否支持加密的。添加上述代码后编译,会出现如下错误:

D:\Research\MySQLite\Debug/../src/sqlite3.c:80963: undefined reference to `sqlite3CodecAttach'

D:\Research\MySQLite\Debug/../src/sqlite3.c:80968: undefined reference to `sqlite3CodecGetKey'

D:\Research\MySQLite\Debug/../src/sqlite3.c:80970: undefined reference to `sqlite3CodecAttach'

src\sqlite3.o: In function `sqlite3Pragma':

D:\Research\MySQLite\Debug/../src/sqlite3.c:94023: undefined reference to `sqlite3_key'

D:\Research\MySQLite\Debug/../src/sqlite3.c:94026: undefined reference to `sqlite3_rekey'

D:\Research\MySQLite\Debug/../src/sqlite3.c:94038: undefined reference to `sqlite3_key'

D:\Research\MySQLite\Debug/../src/sqlite3.c:94040: undefined reference to `sqlite3_rekey'

D:\Research\MySQLite\Debug/../src/sqlite3.c:94048: undefined reference to `sqlite3_activate_see'

src\sqlite3.o: In function `sqlite3RunVacuum':

D:\Research\MySQLite\Debug/../src/sqlite3.c:101744: undefined reference to `sqlite3CodecGetKey'

本文出自 “rainman” 博客,请务必保留此出处http://lancelot.blog.51cto.com/393579/940808

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值