user3444281
user3444281

Reputation: 43

Can't build command line project with SQLite.swift

I'm trying to build a command-line tool which uses sqlite. I have downloaded Stephen Celis' swift wrapper, SQLite.swift, and built a working OS X app. However, I am not able to build my command-line tool. I believe that I correctly followed the instructions to do so in the SQLite.swift Documentation for frameworkless targets, but apparently I am missing something. I get an error in Helper.swift @ import CSQLite -> No such module 'CSQLite'.

I'm happy to send my test project (about 80KB, compressed) to anyone who can and is willing to help. There is probably a very simple solution, I just do not see what it is.

thx for any help,

-Craig

Upvotes: 3

Views: 1249

Answers (1)

Mykola
Mykola

Reputation: 435

I've faced the same problem. There were lots of compiler errors like "Connection.swift:26:8: Could not build Objective-C module 'CSQLite'"

The error has roots to the "lctx.h:13:25: Use of undeclared identifier 'SYS_getlcid'"

It worth mentioning that I have two Xcodes installed - v 6.2 at /Applications and v 7.3 at ~/Applications. My project is iOS app on Swift with SQLite pod and I open it with the Xcode 7.3.

The SQLite pod has a file at project_folder/Pods/SQLite.swift/CocoaPods/iphonesimulator/module.modulemap. The file had the content

module CSQLite [system] { header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h" export * }

To fix compiler errors I changed the content of module.modulemap to

module CSQLite [system] { header "/Users/my_user_name/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h" export * }

The change is that I pointed search of sqlite3.h into my ~/Applications folder where Xcode 7.3 is located. This made my project compiling.

Upvotes: 5

Related Questions