Can a static Xcode library link to a dynamic library?

I created a static library in Xcode that requires several dynamic libraries (e.g. libsqlite3.0.dylib). I can create an application that depends on my static library using cross-project references in Xcode, but it seems to me that I need to manually add all the necessary dynamic libraries to each of my application projects in order to link them.

Is there a way to set up a static library project in Xcode so that dependent applications automatically link to any dynamic libraries that it needs?

I tried adding dynamic libraries to the Framework list in my static library project, but this did not seem to have any effect.

+6
iphone xcode
source share
1 answer

Yes - you will need to add libraries to applications. The static library -.a is just an archive of .o files with a minimal amount of internal resolution. The full resolution of the symbol does not occur until you attach it to the application (or framework).

(Do you use sqlite3 directly? If so, why not use Core Data? There are reasons, but not as often as people ...)

+2
source share

All Articles