【发布时间】:2017-10-17 15:38:45
【问题描述】:
我在 Mac 上尝试将 FTS5 构建为可加载扩展。
我已经下载了SQLite源码,成功执行./configure和make fts5,获得fts5.{c,h}文件。
现在,当我尝试为我得到的扩展构建动态库时:
gcc -g -fPIC -dynamiclib -o fts5.dylib fts5.c
In file included from fts5Int.h:18:0:
fts5_storage.c: In function 'sqlite3Fts5StorageOpen':
fts5_storage.c:305:9: error: 'sqlite3_api_routines' has no member named '__builtin___snprintf_chk'
In file included from /usr/include/secure/_string.h:33:0,
from /usr/include/string.h:192,
from fts5Int.h:21:
fts5_storage.c:305:26: warning: passing argument 1 of '__builtin_object_size' makes pointer from integer without a cast
fts5_storage.c:305:26: note: expected 'const void *' but argument is of type 'int'
In file included from fts5Int.h:18:0:
fts5_storage.c:308:11: error: 'sqlite3_api_routines' has no member named '__builtin___snprintf_chk'
In file included from /usr/include/secure/_string.h:33:0,
from /usr/include/string.h:192,
from fts5Int.h:21:
fts5_storage.c:308:28: warning: passing argument 1 of '__builtin_object_size' makes pointer from integer without a cast
fts5_storage.c:308:28: note: expected 'const void *' but argument is of type 'int'
我做错了什么?
我在 macOS 上尝试了 MacPorts 的 gcc 4.9 和 5.5
有趣的是,在 Linux(和 gcc5)上我收到了这个错误:
❯ gcc -g -fPIC -shared -o fts5.so fts5.c
fts5.h:24:21: fatal error: sqlite3.h: No such file or directory
compilation terminated.
果然在源目录的根目录中没有 sqlite3.h,尽管我希望它应该在 make 步骤中创建? 我当然可以安装 libsqlite3-dev 但我已经拥有了所有的 sqlite 源,我为什么要安装?
【问题讨论】: