我为ARM板定制了linux操作系统。我在yocto构建中为该平台编译了pysqlcipher3。python3程序无法识别共享库中的sqlite3符号。
>>> from pysqlcipher3 import dbapi2 as sqlcipher
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/site-packages/pysqlcipher3/dbapi2.py", line 33, in <module>
from pysqlcipher3._sqlite3 import *
ImportError: /usr/lib/python3.5/site-packages/pysqlcipher3/_sqlite3.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: sqlite3_enable_load_extension但我已经在yocto中添加了sqlite3包。我在rootfs中识别了这个库。
/usr/lib/libsqlite3.so.0
我已经使用nm命令检查了库中的符号,它似乎有缺失的符号(sqlite3_enable_load_extension)。请帮我解决这个问题。一些论坛建议使用LD_PRELOAD选项,这会导致sqlcipher操作混乱。
当我试图打开数据库时,我得到了这个错误
getSingle failed file is encrypted or is not a database发布于 2019-04-19 19:58:11
pysqlcipher模块依赖于设备中的libsqlcipher.so库。应使用--enable-load-extension构建libsqlcipher以避免此错误
对于Yocto构建,我已经在sqlcipher配方文件中添加了标志来避免这个问题。
EXTRA_OECONF = "--enable-load-extension --disable-tcl CFLAGS=-DSQLITE_HAS_CODEC"https://stackoverflow.com/questions/55744917
复制相似问题