XCode 4 中的 PLCrashReporter - 无法在模拟器中编译

发布于 2024-11-11 03:13:59 字数 767 浏览 0 评论 0原文

我一定在这里做了一些完全愚蠢的事情,但我无法将 PLCrashReporter 框架包含在我的项目中。以下是我获取框架的步骤:

  1. 从 google code 上的官方项目网站下载 .dmg 文件
  2. 将 CrashReporter.framework 文件夹复制到我的项目的根目录
  3. 通过转到我的项目,选择目标来添加框架,转到“构建阶段”选项卡,打开“链接二进制文件与库”部分,单击加号,然后添加 CrashReporter.framework 文件夹,

将框架拉入类文件中

我将使用#import

当我尝试在 4.3 模拟器下编译时,出现以下错误:

Undefined keywords for Architecture i386: “_OBJC_CLASS_$_PLCrashReporter”,引用自: AppDelegate+CrashReporting.o 中的 objc-class-ref “_OBJC_CLASS_$_PLCrashReport”,引用自: AppDelegate+CrashReporting.o 中的 objc-class-ref ld:未找到架构 i386 的符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

当我在设备下编译时,一切都很好。我需要包含某种标头或库搜索路径吗?

该应用程序在 XCode 3 下编译,在所有配置下都没有问题。

I must be doing something totally stupid here, but I can't get the PLCrashReporter framework included in my project. Here are the steps I took to get the framework:

  1. Downloaded the .dmg file from the official project site on google code
  2. Copied the CrashReporter.framework folder to the root directory of my project
  3. Added the framework by going to my project, selecting the target, going to the Build Phases tab, opening the Link Binary With Libraries section, clicking the plus sign, and adding the CrashReporter.framework folder

I am pulling in the framework in my class file by using

#import <CrashReporter/CrashReporter.h>

When I try to compile under 4.3 simulator, I get the following errors:

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_PLCrashReporter", referenced from:
objc-class-ref in AppDelegate+CrashReporting.o
"_OBJC_CLASS_$_PLCrashReport", referenced from:
objc-class-ref in AppDelegate+CrashReporting.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When I compile under the device, everything is fine. Is there some sort of header or library search path I need to include?

The app compiles under XCode 3 without issues under all configurations.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

感性 2024-11-18 03:14:00

不要忘记包括

libstdc++.dylib

“链接二进制文件与库”中的

Don't forget to include

libstdc++.dylib

in "Link Binary With Libraries".

万劫不复 2024-11-18 03:13:59

我有同样的问题并且能够解决它。以下是我完成的步骤...

  1. 下载PLCrashReporter 源版本并解压缩。
  2. 打开 PLCrashReporter xcode 项目。该项目设置为使用旧的 SDK,更新每个目标所需的所有 SDK 以消除警告。这也是下一步编译所需要的。
  3. 导航到 CrashReporter-iPhoneSimulator 目标。在“构建设置”下:a) 将“执行单对象预链接”设置为“否”,b) 将“Mach-O 类型”设置为“静态库”。
  4. 选择 CrashReport-iPhoneSimulator : [IOS 模拟(即 iPhone 4.3 Simulator)] 并点击构建。
  5. 导航到 PLCrashReporter 的构建目录。对我来说,它是 /Users/username/Library/Developer/Xcode/DerivedData/CrashReporter-(随机字符)/Build/Products/Debug-iphonesimulator
  6. 将 libCrashReporter-iphonesimulator.a 从步骤 5 中的构建目录复制到 iphone 应用程序要将崩溃报告器添加到的项目目录。
  7. 在 xcode 中打开您的 iphone 应用程序项目。
  8. 下载 PLCrashReporter 二进制版本并将框架解压到本地目录。
  9. 使用此 SO post< 将 CrashReporter 框架添加到您的项目中/a>.
  10. 按照与步骤 9 相同的过程,将 libCrashReporter-iphonesimulator.a 静态库添加到构建阶段的“将二进制文件与库链接”部分。添加静态库时不需要*.framework目录。
  11. 查看目标中的“链接二进制文件与库”。确保 libCrashReporter-iphonesimulator.a 列在 CrashReporter 框架上方。您可以拖放来重新排序。

我希望这有帮助。

I had the same issue and was able to resolve it. Here are the steps I completed...

  1. Download the PLCrashReporter source release and unzip.
  2. Open the PLCrashReporter xcode project. This project is setup to use an old SDK, update all the required SDKs for each target to get rid of the warnings. This is also required to compile in the next step.
  3. Navigate to the CrashReporter-iPhoneSimulator Target. Under the Build Settings: a) set "Perform Single-Object Prelink" to "No", b) set "Mach-O Type" to "Static Library".
  4. Select CrashReport-iPhoneSimulator : [IOS simulation (ie iPhone 4.3 Simulator)] and click build.
  5. Navigate to your build directory for the PLCrashReporter. For me, it was /Users/username/Library/Developer/Xcode/DerivedData/CrashReporter-(random characters)/Build/Products/Debug-iphonesimulator
  6. Copy the libCrashReporter-iphonesimulator.a from the build directory in step 5 to the iphone application project directory you want to add the crash reporter to.
  7. Open the your iphone application project in xcode.
  8. Download the PLCrashReporter binary release and extract the framework to a local directory.
  9. Add the CrashReporter framework to your project using this SO post.
  10. Following the same procedure as step 9, add the libCrashReporter-iphonesimulator.a static library to the "Link Binary with Libraries" section of the build phases. No *.framework directory is needed when adding a static library.
  11. Review the "Link Binary with Libraries" in the Target. Make sure the libCrashReporter-iphonesimulator.a is listed above the CrashReporter framework. You can drag and drop to reorder.

I hope this helps.

方圜几里 2024-11-18 03:13:59

对于寻找此信息的其他人:

我遵循了上面给出的相同步骤,但出现了错误。我删除了静态库,只包含框架(您可以从他们的 dmg 中获取)。

它对我来说非常有效。我认为通过构建项目来创建静态库的过程很旧(在他们创建框架之前)。

谢谢。

For anyone else looking for this information:

I followed the same steps given above however I was getting errors. I deleted the static library and only included the framework (which you can get from their dmg).

It worked perfectly for me. I think the process of creating static library by building the project was old (before they created a framework).

Thanks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文