Reputation: 101
I am trying to add SQLite to my project.I checked the target dependencies under the build phase tab,it is empty, which is true.I am getting the following error:Unable to run command 'Ld SQLite' - this target might include its own product."
I am using swift 3. Can you please help me? Thanks in advance
Upvotes: 5
Views: 7064
Reputation: 438467
Xcode 9 and Swift 3.2 (or, obviously Swift 4), just import SQLite3
in your relevant Swift file ...
import SQLite3
... and it will import the library for you.
In older Xcode versions (or if you turned off automatic library/framework linking), you have to manually link to the libsqlite3
library in the target settings under the “Build Phases”:
But in Xcode 9 with the default settings, all you need is that import
line.
Upvotes: 3
Reputation: 1178
I'm not in front of a Mac at present, but I think all you need to do under Build Phases is go to Link Binaries with Libraries, hit the add button and type in "sqlite" so you can select libsqlite3.
Upvotes: 2