Xcode - Sqlite versions

In Xcode (Mac OS Catalina), when trying to create an application to access a database, I receive syntax errors, resulting from the installed version of SQlite (below 3.30) does not allowing generation of virtual columns. After updating to 3.46 the version installed on system, this does not occur if I execute such queries directly in SQlite, via Terminal. How do I get Xcode to access and use the system updated version ?

Thanks in advance

Answered by Hoffman in 789088022

Short answer: find wherever the added SQLite was installed from whatever installed it, and its name, and add that as a library or SDK reference, and add the header.

Long: I’d expect to either reference and link with the added SQLite in the library settings in the build, or to add the SQLite code itself (SQLite is very modular C).

Here’s an example: SQLiteLib

If you’re using Swift (you’ve not mentioned), I’d look at using a framework wrapper such as SQLite.swift.

If you’re building using C or ObjC, you can pull the SQLite source code itself and the header directly into the project. sqlite3.h and sqlite3ext.h, IIRC.

related SO thread

Accepted Answer

Short answer: find wherever the added SQLite was installed from whatever installed it, and its name, and add that as a library or SDK reference, and add the header.

Long: I’d expect to either reference and link with the added SQLite in the library settings in the build, or to add the SQLite code itself (SQLite is very modular C).

Here’s an example: SQLiteLib

If you’re using Swift (you’ve not mentioned), I’d look at using a framework wrapper such as SQLite.swift.

If you’re building using C or ObjC, you can pull the SQLite source code itself and the header directly into the project. sqlite3.h and sqlite3ext.h, IIRC.

related SO thread

It works !

Using ObjC, I have put the source code into "Compile Sources" and the headers into "Link binary with Libraries" and the errors disappeared

Thank you

Xcode - Sqlite versions
 
 
Q