将 Parsekit 添加到 Xcode 项目
我正在尝试将 Parsekit 框架添加到我的 OSX Xcode 项目中。我以前从未添加过第三方框架,因此无法使其正常工作。
我将包含的 Xcode 项目拖到我的“Groups &”中。文件窗格并选择将其添加到我的项目中。然后,我将 Parsekit.framework
拖到 Link Binary With Libraries
标题下方。然后,我双击目标应用程序并将 Parsekit
添加为直接依赖项。我还添加了 libicucore.dylib 作为链接库(正如它所说在他们的网站上执行此操作)。最后,在目标信息的“构建设置”选项卡中,我将“标题搜索路径”设置为“/Users/path/to/include/directory”,并将“其他链接器标志”设置为“ 到 -ObjC -all_load
。
将其作为调试版本运行可以正常工作,没有错误。但是,当我构建要发布的应用程序,然后尝试运行创建的可执行文件时,该应用程序无法加载,并显示以下错误消息:
由于出现问题,MyApp 无法打开。请与开发人员联系,确保 myApp 可与此版本的 Mac OS X 配合使用。
以下是崩溃报告程序的转储:
进程:MyApp [11658] 路径:
/Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp 标识符:com.yourcompany.MyApp 版本: ??? (???) 代码类型: X86-64(本机)父进程: launchd [135] 日期/时间:
2010-05-24 17:08:08.475 +0100 操作系统 版本:Mac OS X 10.6.3 (10D573) 报告版本:自上次以来的 6 个间隔 报告:133300 秒崩溃 自上次报告以来:每个应用程序 3 个 自上次报告以来的崩溃次数:3 匿名 UUID:
DF0265E4-B5A0-45E1-8B71-D52A27CFDDCA异常类型:EXC_BREAKPOINT (SIGTRAP) 异常代码: 0x0000000000000002, 0x0000000000000000 崩溃的线程:0
Dyld 错误消息:库不存在 已加载: @executable_path/../Frameworks/ParseKit.framework/Versions/A/ParseKit 参考自: /Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp 原因:找不到图片
型号:MacBookPro5,5,BootROM MBP55.00AC.B03,2 个处理器,英特尔 酷睿 2 双核、2.53 GHz、4 GB、SMC 1.47f2 显卡:NVIDIA GeForce 9400M、NVIDIA GeForce 9400M,PCI,256 MB 内存 模块:global_name 机场: spairport_wireless_card_type_airport_extreme (0x14E4、0x8D)、博通 BCM43xx 1.0 (5.10.91.27) 蓝牙:版本 2.3.1f4,2个服务,2个设备,1个传入串口网络服务: AirPort、AirPort、en1 网络服务: 以太网适配器 (en6)、以太网、en6 串行 ATA 设备:日立 HTS545025B9SA02,232.89 GB 串行 ATA 设备:HL-DT-ST DVDRW GS23N USB 设备:内置iSight,0x05ac (苹果公司)、0x8507、0x24400000 USB 设备:内部存储卡读卡器, 0x05ac(苹果公司)、0x8403、 0x26500000 USB设备:红外接收器, 0x05ac(苹果公司)、0x8242、 0x04500000 USB 设备:Apple 内部 键盘/触控板,0x05ac(Apple Inc.)、0x0237、0x04600000 USB 设备: BRCM2046 集线器,0x0a5c(博通 公司)、0x4500、0x06100000 USB 设备: 蓝牙 USB 主控制器,0x05ac (苹果公司),0x8213,0x06110000
构建应用程序后,除了可执行文件之外,Xcode 还会创建一个名为 MyApp.app.dSYM
的文件。知道那是什么吗?
我正在运行 10.6.3 的 Intel MBP 上使用 Xcode 3.2.2 进行开发。
非常感谢您提供的任何帮助。
编辑:新问题! 非常感谢 diciu 的建议 - 最初我以为他们已经解决了问题。但是,我将编译后的应用程序复制到我妻子的 Macbook(Intel,运行 10.6.3)上,但它无法启动。相反,我收到以下错误消息:
您无法打开应用程序 MyApp,因为此类 Mac 不支持它。
在 MyApp 的“构建”设置中,我将“有效架构”设置为“i386 x86_64”,因此它应该可以工作。这可能是由什么引起的?
编辑:问题已解决 我无意中检查了构建设置中的仅构建活动架构
标志。取消选中此选项解决了我的问题。非常感谢!
I am trying to add the Parsekit framework to my OSX Xcode project. I've never added a 3rd party framework before and I can't get it to work right.
I dragged the included Xcode project into my 'Groups & Files' pane and chose to Add it to my project. I then dragged Parsekit.framework
underneath the Link Binary With Libraries
heading. Then I double-clicked my target app and added Parsekit
as a Direct Dependency. I also added libicucore.dylib
as a Linked Library (as it says to do this on their site). Finally, in the Build settings tab of my target info I set the Header Search Paths
to /Users/path/to/include/directory
and the Other Linker Flags
to -ObjC -all_load
.
Running this as a debug build work fine with no errors. However, when I build my app to release and then try to run the executable created, the app fails to load with the following error message:
MyApp cannot be opened because of a problem. Check with the developer to make sure myApp works with this version of Mac OS X.
Here is the dump from the crash reporter:
Process: MyApp [11658] Path:
/Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp
Identifier: com.yourcompany.MyApp
Version: ??? (???) Code Type:
X86-64 (Native) Parent Process:
launchd [135] Date/Time:
2010-05-24 17:08:08.475 +0100 OS
Version: Mac OS X 10.6.3 (10D573)
Report Version: 6Interval Since Last
Report: 133300 sec Crashes
Since Last Report: 3 Per-App
Crashes Since Last Report: 3
Anonymous UUID:
DF0265E4-B5A0-45E1-8B71-D52A27CFDDCAException Type: EXC_BREAKPOINT
(SIGTRAP) Exception Codes:
0x0000000000000002, 0x0000000000000000
Crashed Thread: 0Dyld Error Message: Library not
loaded:
@executable_path/../Frameworks/ParseKit.framework/Versions/A/ParseKit
Referenced from:
/Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp
Reason: image not foundModel: MacBookPro5,5, BootROM
MBP55.00AC.B03, 2 processors, Intel
Core 2 Duo, 2.53 GHz, 4 GB, SMC 1.47f2
Graphics: NVIDIA GeForce 9400M, NVIDIA
GeForce 9400M, PCI, 256 MB Memory
Module: global_name AirPort:
spairport_wireless_card_type_airport_extreme
(0x14E4, 0x8D), Broadcom BCM43xx 1.0
(5.10.91.27) Bluetooth: Version
2.3.1f4, 2 service, 2 devices, 1 incoming serial ports Network Service:
AirPort, AirPort, en1 Network Service:
Ethernet Adaptor (en6), Ethernet, en6
Serial ATA Device: Hitachi
HTS545025B9SA02, 232.89 GB Serial ATA
Device: HL-DT-ST DVDRW GS23N USB
Device: Built-in iSight, 0x05ac
(Apple Inc.), 0x8507, 0x24400000 USB
Device: Internal Memory Card Reader,
0x05ac (Apple Inc.), 0x8403,
0x26500000 USB Device: IR Receiver,
0x05ac (Apple Inc.), 0x8242,
0x04500000 USB Device: Apple Internal
Keyboard / Trackpad, 0x05ac (Apple
Inc.), 0x0237, 0x04600000 USB Device:
BRCM2046 Hub, 0x0a5c (Broadcom
Corp.), 0x4500, 0x06100000 USB Device:
Bluetooth USB Host Controller, 0x05ac
(Apple Inc.), 0x8213, 0x06110000
After building the app, in addition to the executable file, Xcode is also creating a file called MyApp.app.dSYM
. Any idea what that is??
I am developing with Xcode 3.2.2 on an Intel MBP running 10.6.3.
Many thanks for any help offered.
Edit: New problem!
Many thanks to diciu for your suggestions - initially I thought they had solved the problem. However, I copied the compiled app over to my wife's Macbook (Intel, running 10.6.3) but it won't launch. Instead I get the following error message:
You can't open the application MyApp because it is not supported on this type of Mac.
In the Build settings of MyApp, I have Valid architectures
set to i386 x86_64
so it should work. What could this be caused by?
Edit: Problem solved
I had inadvertently checked the Build active architecture only
flag in the Build settings. Unchecking this fixed my problem. Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须在目标下创建一个“复制文件”步骤。
右键单击您的目标,选择“添加”-> “新建阶段”-> “新副本文件构建阶段”。
对于目的地,选择“框架”。
在新创建的构建阶段下,拖动 Parsekit 框架。
构建目录中的 dsym 包包含调试符号。
You have to create a "copy files" step under your target.
Right click your target, choose "Add" -> "New Build Phase" -> "New Copy Files Build Phase".
For destination choose "Frameworks".
Under the newly created build phase, drag your Parsekit framework.
The dsym package from your build directory contains debugging symbols.
ParseKit 的开发者在这里。
执行此操作的方法在 Xcode 4 中已更改。请参阅我对 如何将 ParseKit 作为私有框架嵌入 Mac 应用程序包中的答案 有关如何在 Mac 应用程序的 Xcode 4 中执行此操作的详细说明。
Developer of ParseKit here.
The method for doing this has changed in Xcode 4. See my answer to How to embed ParseKit as a private framework in a Mac App bundle for detailed instructions on how to do this in Xcode 4 for a Mac App.