charlyatwork
charlyatwork

Reputation: 1197

Link Realm within a dynamic library ends in "ld: framework not found Realm for architecture i386"

I've created a custom dynamic library (let's call in LogLibrary.framework) in Swift 2.1. No I'd like to link the Realm.framework and RealmSwift.framework with it.

I did follow the installation instructions provided on https://realm.io/docs/swift/latest/.

These steps are:

enter image description here

Unfortionally, if l link the LogLibrary.framework in my sample Application, I always get the following compile error:

ld: framework not found Realm for architecture i386

I did not set any additional linker flags in the sample Application.

enter image description here

However, It works if I also link the Realm.framework and RealmSwift.framework in the sample Application - but that's not what I want, because they are already linked within the LogLibrary.framework

Any Ideas how I can get rid of the compile error? Sample Project: https://github.com/sehdich/RealmLinkError.git

Upvotes: 3

Views: 2358

Answers (1)

kishikawa katsumi
kishikawa katsumi

Reputation: 10563

You should link Realm and RealmSwift.framework to PhotoApp target too. Because those frameworks are not static libraries. They are linked dynamically. So they are still specified to link app's target and included in app bundle.

enter image description here

Upvotes: 2

Related Questions