我正在尝试将自定义sqlite3 regexp函数添加到我的Qt应用程序中(根据this answer的建议)。它在Windows中工作正常但在fedora中我得到了这个错误:
: - 1:错误:sqlite3.o:对符号'dlclose @@ GLIBC_2.2.5'的未定义引用
将LIBS += -ldl
添加到.pro
之后,编译就可以,但是当运行命令query.exec();
时,返回值为false
,没有任何描述,而qtregexp()
函数则没有运行
编辑:
评论后
LIBS += -ldl
SOURCES += sqlite\sqlite3.c
HEADERS += sqlite\sqlite3.h
并添加
LIBS += -lsqlite3
到.pro
segmentation fault
sqlite3_create_function
。
如果我使用原生sqlite3 API打开数据库( sqlite3_open )而不是处理 QSqlDatabase ,sqlite3_create_function正常工作非常好