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.
我正在尝试将Parsekit框架添加到我的OSX Xcode项目中。我以前从未添加过第三方框架,我无法让它正常工作。
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
.
我将包含的Xcode项目拖放到“group & Files”窗格中,并选择将其添加到项目中。然后,我将Parsekit.framework拖到与库标题的链接二进制文件下。然后我双击目标应用程序,添加Parsekit作为直接依赖项。我还添加了libicucore。dylib作为一个链接库(就像它在网站上说的那样)。最后,在我的目标信息的Build settings选项卡中,我将头搜索路径设置为/Users/path/to/include/directory,并将其他链接器标记设置为-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.
MyApp因为问题无法打开。请与开发人员联系,以确保myApp与这个版本的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-D52A27CFDDCA过程:MyApp[11658]路径:/用户/Garry/编程/Xcode/Mac/MyApp/build/Release/MyApp。应用程序/内容/ MacOS / MyApp标识符:com.yourcompany。MyApp版:? ? ?(? ? ?)代码类型:X86-64(本机)父进程:launchd[135]日期/时间:2010-05-24 17:08:08 08.475 +0100 OS版本:Mac OS X 10.6.3
Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000002, 0x0000000000000000 Crashed Thread: 0
异常类型:EXC_BREAKPOINT (SIGTRAP)异常代码:0x00000000000000000000000000000002, 0x0000000000000000崩溃的线程:0
Dyld 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 found
Dyld错误消息:库未加载:@executable_path/. /框架/ParseKit.framework/版本/A/ParseKit引用自:/Users/Garry/编程/Xcode/Mac/MyApp/build/Release/MyApp。app/内容/MacOS/MyApp原因:图片未找到
Model: 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
模型:MacBookPro5 5 BootROM MBP55.00AC。B03 2处理器,英特尔酷睿2双核2.53 GHz,4 GB,SMC 1.47 f2图形:NVIDIA GeForce 9400 m,NVIDIA GeForce 9400 m,PCI,256 MB内存模块:global_name机场:spairport_wireless_card_type_airport_extreme(0 x14e4,0 x8d),Broadcom BCM43xx 1.0(5.10.91.27)蓝牙:版本2.3.1f4 2服务,2设备,1输入串行端口网络服务:机场,机场,en1网络服务:以太网适配器(en6),以太网,en6串行ATA设备:日立HTS545025B9SA02 232.89 GB串行ATA设备:HL-DT-ST DVDRW GS23N USB设备:内置iSight,0 x05ac(苹果公司),0 x8507 0 x24400000 USB设备:内存读卡器,0 x05ac(苹果公司),0 x8403 0 x26500000 USB设备:红外接收器,0 x05ac(苹果公司),0 x8242 0 x04500000 USB设备:苹果内部键盘/触摸板,0 x05ac(苹果公司),0 x0237 0 x04600000 USB设备:BRCM2046中心0 x0a5c(Broadcom corp .),0 x4500集成,0 x06100000 USB设备:蓝牙USB主机控制器,0x05ac(苹果公司),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??
在构建应用程序之后,除了可执行文件之外,Xcode还创建了一个名为MyApp.app.dSYM的文件。你知道那是什么吗?
I am developing with Xcode 3.2.2 on an Intel MBP running 10.6.3.
我正在用Xcode 3.2.2开发一个运行10.6.3的Intel MBP。
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:
编辑:新问题!非常感谢diciu的建议——起初我认为他们已经解决了这个问题。然而,我将编译后的应用程序复制到我妻子的Macbook上(Intel,运行10.6.3),但它不会启动。相反,我得到以下错误消息:
You can't open the application MyApp because it is not supported on this type of Mac.
不能打开应用程序MyApp,因为这种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?
在MyApp的构建设置中,我将有效的体系结构设置为i386 x86_64,因此它应该可以工作。这可能是由什么引起的呢?
Edit: Problem solved I had inadvertently checked the Build active architecture only
flag in the Build settings. Unchecking this fixed my problem. Many thanks!
编辑:错误地解决了我在构建设置中只检查了构建活动体系结构标志的问题。我的问题解决了。很多谢谢!
2 个解决方案
#1
6
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.
在新创建的构建阶段,拖动Parsekit框架。
The dsym package from your build directory contains debugging symbols.
来自构建目录的dsym包包含调试符号。
#2
1
Developer of ParseKit here.
开发商ParseKit这里。
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.
在Xcode 4中,实现此目的的方法已经更改。关于如何在Mac应用程序包中嵌入ParseKit作为私有框架的详细说明,请参见我的答案。
#1
6
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.
在新创建的构建阶段,拖动Parsekit框架。
The dsym package from your build directory contains debugging symbols.
来自构建目录的dsym包包含调试符号。
#2
1
Developer of ParseKit here.
开发商ParseKit这里。
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.
在Xcode 4中,实现此目的的方法已经更改。关于如何在Mac应用程序包中嵌入ParseKit作为私有框架的详细说明,请参见我的答案。