0
我在Mac上試圖構建FTS5作爲可加載擴展。SQLite:構建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'
我在做什麼錯?
我試過GCC 4.9和5.5的MacPorts從在MacOS
有趣的是,在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資源,爲什麼要這樣?