1

I'm successfully using the great Swift wrapper for sqlite from https://github.com/stephencelis/SQLite.swift in a Cocoa application.

But when I try to use the wrapper in a Command Line Tool project and follow the same detailed installation steps I get the following error:

Check dependencies

Unable to run command 'PBXCp SQLite.framework' - this target might include its own product.

I checked the dependencies, but couldn't figure out how to solve this.

stephencelis
  • 4,954
  • 2
  • 29
  • 22
Klaas
  • 22,394
  • 11
  • 96
  • 107

1 Answers1

1

You can't link dynamic framework (a .framework) with your app in a Command Line Tool project. The reason is simple — a command line tool target builds a single binary file. This is unlike a regular Cocoa application, where the .app "file" is actually a folder containing .frameworks and other stuff inside.

So basically you'd have to build a static library instead (one that links with your app's binary during compilation) — except that as of Xcode 6.1 it's not possible yet with Swift.

So the only thing you can do — AFAIK — is add the SQLite.swift's source code directly into your own app target (so it compiles together). It's ugly, but works.

radex
  • 6,336
  • 4
  • 30
  • 39
  • There is another question regarding the same issue: http://stackoverflow.com/questions/630911/using-frameworks-in-a-command-line-tool – Klaas Oct 29 '14 at 22:27