Sqlite.swift: Error: Failed to build SQLite for a executable swift package

Created on 10 May 2020  路  5Comments  路  Source: stephencelis/SQLite.swift

Build Information

  • Xcode v11.3.1
  • macOS 10.15.4

General guidelines

  • steps
$ mkdir SQLiteDemoExecutable
$ cd SQLiteDemoExecutable
$ swift package init --type executable
$ swift run 

[3/3] Linking SQLiteDemoExecutable
Hello, world!

  • add .package(url: "https://github.com/stephencelis/SQLite.swift.git", from: "0.12.0") to Package.swift
  • add target dependencies: ["SQLite"]),
$ swift run 

I got : 3 warnings and 16 errors generated.

The executable can not be built!

- Error Messages:

sunwrt@localhost SQLiteDemoExecutable % swift run
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:126:9: warning: 'SQLITE_SOURCE_ID' macro redefined [-Wmacro-redefined]

define SQLITE_SOURCE_ID "2017-03-28 18:48:43 424a0d380332858ee55bdebc4af3789f74e70a2b3ba1cf29d84b9b4bcf3e2e37"

    ^

/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:141:9: note: previous definition is here

define SQLITE_SOURCE_ID "2019-04-15 14:49:49 378230ae7f4b721c8b8d83c8ceb891449685cd23b1702a57841f1be40b5daapl"

    ^

In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:654:8: error: redefinition of 'sqlite3_file'
struct sqlite3_file {
^
/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:691:8: note: previous definition is here
struct sqlite3_file {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:752:8: error: redefinition of 'sqlite3_io_methods'
struct sqlite3_io_methods {
^
:8: note: previous definition is here
struct sqlite3_io_methods {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:1234:8: error: redefinition of 'sqlite3_vfs'
struct sqlite3_vfs {
^
note: previous definition is here
struct sqlite3_vfs {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:1531:8: error: redefinition of 'sqlite3_mem_methods'
struct sqlite3_mem_methods {
^
/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:1651:8: note: previous definition is here
struct sqlite3_mem_methods {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:3708:20: error: typedef redefinition with different types ('struct Mem' vs 'struct sqlite3_value')
typedef struct Mem sqlite3_value;
^
/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:3980:30: note: previous definition is here
typedef struct sqlite3_value sqlite3_value;
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:5848:8: error: redefinition of 'sqlite3_module'
struct sqlite3_module {
^
/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:6225:8: note: previous definition is here
struct sqlite3_module {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:5979:8: error: redefinition of 'sqlite3_index_info'
struct sqlite3_index_info {
^
/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:6359:8: note: previous definition is here
struct sqlite3_index_info {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
:5982:10: error: redefinition of 'sqlite3_index_constraint'
struct sqlite3_index_constraint {
^

struct sqlite3_index_constraint {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
27:

struct sqlite3_index_orderby {
^
/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:6369:10: note: previous definition is here
struct sqlite3_index_orderby {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
:
/usr/local/include/sqlite3.h:5994:10: error: redefinition of 'sqlite3_index_constraint_usage'
struct sqlite3_index_constraint_usage {
^
10: note: previous definition is here
struct sqlite3_index_constraint_usage {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:6092:8: error: redefinition of 'sqlite3_vtab'

   ^

/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:6482:8: note: previous definition is here
struct sqlite3_vtab {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
:27:

struct sqlite3_vtab_cursor {
^
6506:8: note: previous definition is here
struct sqlite3_vtab_cursor {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:6621:8: error: redefinition of 'sqlite3_mutex_methods'
struct sqlite3_mutex_methods {
^
/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:7010:8: note: previous definition is here
struct sqlite3_mutex_methods {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:6794:9: warning: 'SQLITE_TESTCTRL_LAST' macro redefined [-Wmacro-redefined]

define SQLITE_TESTCTRL_LAST 25

    ^

/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:7159:9: note: previous definition is here

define SQLITE_TESTCTRL_LAST 26 /* Largest TESTCTRL */

    ^

In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:7064:9: warning: 'SQLITE_DBSTATUS_MAX' macro redefined [-Wmacro-redefined]

define SQLITE_DBSTATUS_MAX 11 /* Largest defined DBSTATUS */

    ^

: note: previous definition is here

define SQLITE_DBSTATUS_MAX 12 /* Largest defined DBSTATUS */

    ^

In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
7159:8: error: redefinition of 'sqlite3_pcache_page'
struct sqlite3_pcache_page {
^
/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:7746:8: note: previous definition is here
struct sqlite3_pcache_page {
^
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
27:
/usr/local/include/sqlite3.h:7324:8: error: redefinition of 'sqlite3_pcache_methods2'
struct sqlite3_pcache_methods2 {
^
previous definition is here

   ^

In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
In file included from /Users/sunwrt/test/SQLiteDemoExecutable/.build/checkouts/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:
/usr/local/include/sqlite3.h:7347:8: error: redefinition of 'sqlite3_pcache_methods'
struct sqlite3_pcache_methods {
^
/Applications/Xcode11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sqlite3.h:7934:8: note: previous definition is here
struct sqlite3_pcache_methods {
^
3 warnings and 16 errors generated.

[0/2] Compiling SQLiteObjc SQLiteObjc.m

Most helpful comment

I have the same issue

All 5 comments

I was experiencing the same issue.
No such module 'SQLite' when archiving. cocoapods

I have the same issue

I encounter this issue in Xcode 12 Beta 6. Is there any workaround about this?

Same here

Same issue here with Xcode 12 GM seed any solutions?

Was this page helpful?
0 / 5 - 0 ratings