PLCrashReporter in XCode 4 - won't compile in Simulator
Asked Answered
L

3

8

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.

Lizliza answered 31/5, 2011 at 20:3 Comment(0)
U
13

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.

Uncle answered 2/8, 2011 at 14:11 Comment(2)
Hi, the link in first point shows 13 downloads. Which file should we download?Rhoda
Wouldn't it be possible to give access to a project you already setup? Its just so complicated and I don't think everybody understands each step. I also don't know which SDKs you are talking about in step 2.Posting
W
1

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.

Wines answered 15/1, 2014 at 22:41 Comment(1)
Which of them are static libraries? Maybe you could paste a link and explain the steps more in detail.Posting
B
0

Don't forget to include

libstdc++.dylib

in "Link Binary With Libraries".

Basile answered 6/4, 2014 at 20:16 Comment(1)
Any advice why this lib should be included? Its about PLCrashReportPosting

© 2022 - 2024 — McMap. All rights reserved.