[英]What’s the correct way to build the SQLite FTS extension as a DLL?
What's the recommended way to build the SQLite FTS3 extension as a Windows DLL? 将SQLite FTS3扩展构建为Windows DLL的推荐方法是什么?
I'm having the following problem: 我遇到以下问题:
fts3_tokenizer.obj : error LNK2005: sqlite3_api already defined in fts3.obj fts3_tokenizer.obj:错误LNK2005:在fts3.obj中已定义sqlite3_api
The macro SQLITE_EXTENSION_INIT1
is used in both fts3_tokenizer.c
and fts3.c
. 宏SQLITE_EXTENSION_INIT1
中都使用fts3_tokenizer.c
和fts3.c
。 It creates a global variable named sqlite3_api
, and since this is done in two places, there are two global variables of the same name. 它创建了一个名为sqlite3_api
的全局变量,并且由于这是在两个地方完成的,因此有两个同名的全局变量。 Hence the problem. 因此问题。
Note: Although FTS can be compiled into SQLite, I would like a DLL so I can dynamically load the extension into environments where I have a pre-compiled SQLite that doesn't have full text search. 注意:尽管FTS可以编译成SQLite,但我想要一个DLL,以便可以将扩展动态加载到我具有没有全文本搜索的预编译SQLite的环境中。
Main instructions: http://eli.thegreenplace.net/2009/09/23/compiling-sqlite-on-windows/ 主要说明: http : //eli.thegreenplace.net/2009/09/23/compiling-sqlite-on-windows/
But use these preprocessor definitions: 但是,请使用以下预处理程序定义:
SQLITE_ENABLE_COLUMN_METADATA SQLITE_ENABLE_COLUMN_METADATA
SQLITE_ENABLE_FTS3 SQLITE_ENABLE_FTS3
SQLITE_ENABLE_FTS3_PARENTHESIS SQLITE_ENABLE_FTS3_PARENTHESIS
SQLITE_ENABLE_RTREE SQLITE_ENABLE_RTREE
ignore int / i64 and float/double warnings 忽略int / i64和float / double警告
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.