Problem with Frameworks in Command Line Tool


(Happy Human Pointer) #1

Before everyone starts throwing stack-overflow and forum posts at me: I looked at them all. None of them are helping.

I have a simple cmd tool called swizzler and want to embed the SwizzleSrc framework in it. I have followed all the tutorials and stack overflows with no luck. Here is what I am getting.

Build

2019-02-07 19:22:46.785680-0500 Terminal[67444:11837029] flock failed to lock maps file: errno = 35
2019-02-07 19:22:46.786939-0500 Terminal[67444:11837029] flock failed to lock maps file: errno = 35

Run

Last login: Thu Feb  7 19:21:08 on ttys018
NAME-iMac:~ NAME$ /Users/NAME/Library/Developer/Xcode/DerivedData/swizzler-aslysekmorknabdslxbxfaeuiztk/Build/Products/Debug/swizzler ; exit;
dyld: Library not loaded: @rpath/SwizzleSrc.framework/Versions/A/SwizzleSrc
  Referenced from: /Users/NAME/Library/Developer/Xcode/DerivedData/swizzler-aslysekmorknabdslxbxfaeuiztk/Build/Products/Debug/swizzler
  Reason: image not found
Abort trap: 6
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Can someone please help? I have been trying for days with no avail.


(Thomas Roughton) #2

Have you added a Copy Resources phase to the Xcode build settings (copying the framework)? You need to make sure that the build directory for the command-line program contains SwizzleSrc.framework; the rpath should be set to the executable's location by default.