将自定义sqlite函数添加到linux中的Qt应用程序

时间:2018-03-14 11:49:12

标签: qt sqlite

我正在尝试将自定义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正常工作非常好

0 个答案:

没有答案