Hi Christiaan,
I included the output in an earlier email (see below):
TurboMonkey:Current tciuro$ otool -D EDCommon EDCommon: @executable_path/../Frameworks/EDCommon.framework/Versions/A/EDCommon TurboMonkey:Current tciuro$
TurboMonkey:Current tciuro$ otool -D EDMessage EDMessage: @executable_path/../Frameworks/EDMessage.framework/Versions/A/EDMessage TurboMonkey:Current tciuro$
Thanks,
-- Tito On Jun 2, 2010, at 11:38 PM, Christiaan Hofman wrote: On Jun 2, 2010, at 23:27, Tito Ciuro wrote: Hi Christiaan,
I see the following:
Last login: Wed Jun 2 20:23:16 on ttys000 TurboMonkey:~ tciuro$ otool -L /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/MacOS/RichEmailSender /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/MacOS/RichEmailSender: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (Icompatibility version 1.0.0, current version 15.0.0) @executable_path/../Frameworks/EDCommon.framework/Versions/A/EDCommon (compatibility version 34.0.0, current version 34.0.0) @executable_path/../Frameworks/EDMessage.framework/Versions/A/EDMessage (compatibility version 17.0.0, current version 17.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.19.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 751.21.0) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1038.29.0) TurboMonkey:~ tciuro$
Thanks,
-- Tito
And what does otool -D say on the framework executables?
Christiaan On Jun 2, 2010, at 11:23 PM, Christiaan Hofman wrote: On Jun 2, 2010, at 20:33, Tito Ciuro wrote: Hello,
This is what I see:
TurboMonkey:Current tciuro$ otool -D EDCommon EDCommon: @executable_path/../Frameworks/EDCommon.framework/Versions/A/EDCommon TurboMonkey:Current tciuro$
TurboMonkey:Current tciuro$ otool -D EDMessage EDMessage: @executable_path/../Frameworks/EDMessage.framework/Versions/A/EDMessage TurboMonkey:Current tciuro$
Inspecting the app reveals:
TurboMonkey:Current tciuro$ cd /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/Frameworks/EDCommon.framework/Versions/A/ TurboMonkey:A tciuro$ ls -al total 2048 drwxr-xr-x 5 tciuro staff 170 Jun 2 20:25 . drwxr-xr-x 4 tciuro staff 136 Jun 2 20:25 .. -rwxr-xr-x 1 tciuro staff 1048576 Jun 2 20:25 EDCommon drwxr-xr-x 59 tciuro staff 2006 Jun 2 20:25 Headers drwxr-xr-x 6 tciuro staff 204 Jun 2 20:25 Resources TurboMonkey:A tciuro$ TurboMonkey:A tciuro$ TurboMonkey:A tciuro$ cd /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/Frameworks/EDMessage.framework/Versions/A/TurboMonkey:A tciuro$ ls -al total 1848 drwxr-xr-x 5 tciuro staff 170 Jun 2 20:25 . drwxr-xr-x 4 tciuro staff 136 Jun 2 20:25 .. -rwxr-xr-x 1 tciuro staff 942280 Jun 2 20:25 EDMessage drwxr-xr-x 29 tciuro staff 986 Jun 2 20:25 Headers drwxr-xr-x 4 tciuro staff 136 Jun 2 20:25 Resources TurboMonkey:A tciuro$
So the @executable path in both frameworks seems to be pointing in the right direction. Anything else that could be missing?
Thank you,
-- Tito
That seem to be OK. Are you sure you have the copy and link build phases correct? Another thing you can check is "otool -L /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/MacOS/RichEmailSender", and see if the path to the frameworks appear correctly.
Christiaan
On Jun 2, 2010, at 8:07 PM, Dong Feng wrote:
You may try "otool -D" to see if the dynamic linked binary has an "install name" starting with "@executable." If it is not, that is the problem and I so far have not known a way to change it without having access to the source code.
2010/6/3 Tito Ciuro <email@hidden>
Hello,
Earlier today I sent this email to the Cocoa-dev list, but I later realized that this issue was more Xcode than Cocoa related. My apologies for cross-posting, it was never my intention do that on purpose.
I'm having some trouble embedding a framework in my app. I've done that countless times before in other projects and it worked fine, but for some reason, it doesn't work this time around. I don't know what I'm missing and I get the feeling I'm running in circles. The app launches (and works) fine if I launch it from Xcode. However, if I launch from Finder I see the following in Console.app
> 6/2/10 11:05:46 AM [0x0-0x192192].com.yourcompany.RichEmailSender[4390] dyld: Library not loaded: @executable_path/../Frameworks/EDCommon.framework/Versions/A/EDCommon
> 6/2/10 11:05:46 AM [0x0-0x192192].com.yourcompany.RichEmailSender[4390] Referenced from: /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/MacOS/RichEmailSender
> 6/2/10 11:05:46 AM [0x0-0x192192].com.yourcompany.RichEmailSender[4390] Reason: image not found
> 6/2/10 11:05:46 AM com.apple.launchd.peruser.501[143] ([0x0-0x192192].com.yourcompany.RichEmailSender[4390]) Job appears to have crashed: Trace/BPT trap
> 6/2/10 11:05:46 AM ReportCrash[4393] Saved crash report for RichEmailSender[4390] version ??? (???) to /Users/tciuro/Library/Logs/DiagnosticReports/RichEmailSender_2010-06-02-110546_TurboMonkey.crash
> 6/2/10 11:08:34 AM RichEmailSender[4441] *** Assertion failure in -[MessageExample createMessage], /Users/tciuro/Desktop/RichEmailSender/MessageExample.m:23
> 6/2/10 11:08:34 AM RichEmailSender[4441] could not load image
The crash referenced above shows:
> Process: RichEmailSender [4390]
> Path: /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/MacOS/RichEmailSender
> Identifier: com.yourcompany.RichEmailSender
> Version: ??? (???)
> Code Type: X86 (Native)
> Parent Process: launchd [143]
>
> Date/Time: 2010-06-02 11:05:46.302 +0200
> OS Version: Mac OS X 10.6.3 (10D573)
> Report Version: 6
>
> Exception Type: EXC_BREAKPOINT (SIGTRAP)
> Exception Codes: 0x0000000000000002, 0x0000000000000000
> Crashed Thread: 0
>
> Dyld Error Message:
> Library not loaded: @executable_path/../Frameworks/EDCommon.framework/Versions/A/EDCommon
> Referenced from: /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/MacOS/RichEmailSender
> Reason: image not found
I have googled for info and I've seen a lot of info (and misinformation as well), so I tried the following:
1) Drag the frameworks (EDMEssage + EDCommon) to my Xcode project
2) Added a Copy Files Build Phase to the target
3) Selected Frameworks from the popup and checked Copy only when installing (info window of the Copy Files Build Phase)
4) Set the Runpath Search Paths to @loader_path/../Frameworks/
Running otool -l shows the following:
> TurboMonkey:~ tciuro$ otool -L /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/MacOS/RichEmailSender
> /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app/Contents/MacOS/RichEmailSender:
> /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 15.0.0)
> @executable_path/../Frameworks/EDCommon.framework/Versions/A/EDCommon (compatibility version 34.0.0, current version 34.0.0)
> @executable_path/../Frameworks/EDMessage.framework/Versions/A/EDMessage (compatibility version 17.0.0, current version 17.0.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1)
> /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.19.0)
> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 751.21.0)
> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1038.29.0)
> TurboMonkey:~ tciuro$
The contents of the built app show:
> Last login: Wed Jun 2 11:11:14 on ttys000
> TurboMonkey:~ tciuro$ cd /Users/tciuro/Desktop/Builds/Debug/RichEmailSender.app
> TurboMonkey:RichEmailSender.app tciuro$ cd Contents/
> TurboMonkey:Contents tciuro$ ls -al
> total 16
> drwxr-xr-x 7 tciuro staff 238 Jun 2 11:08 .
> drwxr-xr-x 3 tciuro staff 102 Jun 2 11:08 ..
> drwxr-xr-x 4 tciuro staff 136 Jun 2 11:08 Frameworks
> -rw-r--r-- 1 tciuro staff 906 Jun 2 11:08 Info.plist
> drwxr-xr-x 3 tciuro staff 102 Jun 2 11:08 MacOS
> -rw-r--r-- 1 tciuro staff 8 Jun 2 11:08 PkgInfo
> drwxr-xr-x 4 tciuro staff 136 Jun 2 11:08 Resources
> TurboMonkey:Contents tciuro$ cd Frameworks/
> TurboMonkey:Frameworks tciuro$ ls -al
> total 0
> drwxr-xr-x 4 tciuro staff 136 Jun 2 11:08 .
> drwxr-xr-x 7 tciuro staff 238 Jun 2 11:08 ..
> drwxr-xr-x 6 tciuro staff 204 Jun 2 11:08 EDCommon.framework
> drwxr-xr-x 6 tciuro staff 204 Jun 2 11:08 EDMessage.framework
> TurboMonkey:Frameworks tciuro$
So the frameworks are there and supposedly referenced correctly. Then... why can't the library be loaded? Is there anything else I need to do? Anything else I'm perhaps missing? If you need to see the project, please contact me offline, as I don't want to spam the list with my stuff.
Thanks in advance,
-- Tito
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|