Skip to content

Conversation

@bmwalters
Copy link

Problem

When using SQLite.swift/standalone with sqlite3 pod version >= 3.30.0, attempting to build the project results in "ambiguous use" warning in Xcode pointing here.

Solution

SQLite 3.30.0 changed the definition of SQLITE_DETERMINISTIC:

-#define SQLITE_DETERMINISTIC    0x800
+#define SQLITE_DETERMINISTIC    0x000000800

Meaning that the (older) system sqlite3 library and the pod have different definitions, even though they're the same value.

We've been importing the system SQLite3 module in SQLiteObjc.h even when linking against standalone sqlite.

I added a check to SQLiteObjc.h to import the sqlite3 pod when we're using it, instead of always importing the system module.

This leads to there being only one definition in scope.

SQLite 3.30.0 changed the definition of SQLITE_DETERMINISTIC:
`-#define SQLITE_DETERMINISTIC    0x800`
`+#define SQLITE_DETERMINISTIC    0x000000800`

Meaning that the (older) system sqlite3 library and the pod have
different definitions, even though they're the same value.

We've been importing the system sqlite3 module in SQLiteObjc.h
even when linking against standalone sqlite.

I added a check to SQLiteObjc.h to import the sqlite3 pod when
we're using it, instead of always importing the system module.

This leads to there being only one definition in scope.
@ryanholden8
Copy link

Running into the same issue. Thank you for the solution!

@jberkel
Copy link
Collaborator

jberkel commented Jan 19, 2020

Thanks, I've just run into this as well.

@jberkel jberkel closed this Jan 19, 2020
pull bot pushed a commit to FreddyZeng/SQLite.swift that referenced this pull request Jan 19, 2020
Fix building with standalone sqlite3 >= 3.30.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants