PLCrashReporter in XCode 4 - won't compile in Simulator - xcode4

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:
Downloaded the .dmg file from the official project site on google code
Copied the CrashReporter.framework folder to the root directory of my project
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.

I had the same issue and was able to resolve it. Here are the steps I completed...
Download the PLCrashReporter source release and unzip.
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.
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".
Select CrashReport-iPhoneSimulator : [IOS simulation (ie iPhone 4.3 Simulator)] and click build.
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
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.
Open the your iphone application project in xcode.
Download the PLCrashReporter binary release and extract the framework to a local directory.
Add the CrashReporter framework to your project using this SO post.
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.
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.

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.

Don't forget to include
libstdc++.dylib
in "Link Binary With Libraries".

Related

Cannot find c:\Users\qt\work\install\lib\Qt5Widgetsd.lib when compiling QtWebEngine examples

I downloaded Qt5.6 VS2013 32bit and try to run the official example of QtWebEngine.
I just followed the instruction but
When linking it gives out an error of
LNK1104 file not found c:\Users\qt\work\install\lib\Qt5Widgetsd.lib.
However, I have no idea of where this path c:\Users\qt\work\install\lib\ comes from.
I did text search in all directories of example folder and no hits other than generated files(makefiles and pdbs).
I also checked system environment variables but no hits.
Furthermore, I checked Qt Creator'r Projects panel and its Build Environment and still no hits.
Did I miss something?
P.S. this error was given out by linking DemoBrowser example of QtWebEngineWidgets pro
The link is generated by qmake when it generates the build scrip from the qt project file (*.pro). It is based from the qmake application path that is generaly installed together with the libraries (check you qt kit setup to change it if needed: Jst browse to qmake.exe application).
Then try regenerate the build script. It should fix the issue.
You may also have issue with installation not being in debug mode; you are trying to use Qt5Widgetsd.lib library instead of the non-debug one Qt5Widgets.lib

Link Realm within a dynamic library ends in "ld: framework not found Realm for architecture i386"

I've created a custom dynamic library (let's call in LogLibrary.framework) in Swift 2.1. No I'd like to link the Realm.framework and RealmSwift.framework with it.
I did follow the installation instructions provided on https://realm.io/docs/swift/latest/.
These steps are:
Link Binary with Libraries (Realm.framework and RealmSwift.framework added)
Build Phase -> Add copy files Phase -> Destination "Frameworks"
Run Script Phase -> bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework/strip-frameworks.sh"
Unfortionally, if l link the LogLibrary.framework in my sample Application, I always get the following compile error:
ld: framework not found Realm for architecture i386
I did not set any additional linker flags in the sample Application.
However, It works if I also link the Realm.framework and RealmSwift.framework in the sample Application - but that's not what I want, because they are already linked within the LogLibrary.framework
Any Ideas how I can get rid of the compile error?
Sample Project: https://github.com/sehdich/RealmLinkError.git
You should link Realm and RealmSwift.framework to PhotoApp target too. Because those frameworks are not static libraries. They are linked dynamically. So they are still specified to link app's target and included in app bundle.

Qt 5: Debug\release and Release\debug directories

I use Qt 5.0.1 with Windows SDK 7.1. If I create a new application, the Kits page of the New app wizard offers to create Debug and Release directories:
Debug: C:\Projects\MyProject-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Debug
Release: C:\Projects\MyProject-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release
1) If I compile the app in Debug mode, Qt Creator creates two directories:
C:\Projects\MyProject-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Debug\debug
C:\Projects\MyProject-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Debug\release
The executable will be created in the former, C:\...-Debug\debug.
2) If I compile the app in Release mode, I will get another pair of directories:
C:\Projects\MyProject-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release\debug
C:\Projects\MyProject-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release\release
In this case, the executable will be placed in the latter, C:\...-Release\release.
What is the logic behind this nested directory structure? When does the IDE use the directories C:\...-Debug\release and C:\...-Release\debug?
UPDATE
#phyatt pointed out that turning off shadow building in project settings eliminates the problem. The debug and release directories will be generated inside the project's source directory:
C:\Projects\MyProject\debug
C:\Projects\MyProject\release
Unfortunately, this doesn't answer the above question. Moreover, now the project settings page displays a warning:
An incomplete build exists in C:\Projects\MyProject, which will be
overwritten.
If you are only using a single compiler, I would go into the Projects tab > Build > General > Shadow Build, and uncheck Shadow Build.
This will simplify the configuration and folder structure, and may fix the bug for you.
Maybe go in and do a build clean for good measure.
Hope that helps.

Build Kobold2d project from command line

I posted this on the Kobold2d forums but haven't received any replies yet. I'm hoping the larger audience here at SO can help.
I'm trying to get our Kobold2d project working with our Hudson CI server. I'd like to have a script that executes the proper command line build instructions using xcodebuild, but I'm running into a problem with any Kobold2d project.
As a test I created a Orthogonal-Tilemap template project and built/ran it in the xcode 4.4.1 gui successfully. Building the projects individually from the command line the Kobold2D-Libraries.xcodeproj reports a successful build (though I have no idea where any products are stored), but the tilemap project fails with the message:
ld: file not found: <path>/Kobold2D/Kobold2D-2.0.3/BuildTest/build/Release-iphoneos/libkobold2d-ios.a
The only information I can find on this message talks about errors from building in the xcode gui, which is not the problem.
I also tried having xcodebuild build the workspace file but that failed with multiple dependency errors.
Has anyone found a way to successfully build Kobold2d projects from the command line?
Thanks!
Actually I use Hudson to automate Kobold2D builds. Here's the build script for Hudson.
I can see from your path that you changed Xcode's default build locations (Advanced, next to Derived Data in Preferences -> Locations). There's one setting (legacy) that doesn't work at all with Kobold2D, and should actually open a browser window explaining the issue should you have used that setting.
I think your setting is "relative to project" or something similar. Try changing the build location to Xcode default (Unique) and try again. You can use a custom location for derived data if you want to.
In any case, if the output location path of build products ends up being somewhere in the app project folder (in this case: BuildTest) then ld won't be able to find dependencies because they're not all in the same folder. If you do require this you could add a pre-link step that copies the .a files to the correct location. But it's best to avoid this because it'll be prone to breaking.
My script includes
xcodebuild -workspace Bulge.xcworkspace -scheme Bulge-iOS -sdk ${sdk} archive || die "Archive failed"

qt cannot open input file 'c:\Qt\qt\lib\qtmaind.lib'

I am using qt 4.5
I have created a project and I want to compile on visual studio 2008 for windows mobile 6.0
So I have created the project files doing this:
D:\Projects\Phone_PDA\Phone_PDA>set QMAKESPEC=win32-msvc2008
D:\Projects\Phone_PDA\Phone_PDA>qmake -tp vc
The VS project was created. However, when I try and compile I get this error:
LINK : fatal error LNK1181: cannot open input file 'c:\Qt\qt\lib\qtmaind.lib'
However, when I check my librarys and includes under project properties in visual studio. I have this:
Additional Include Directories
c:\Qt\qt\include\QtCore
c:\Qt\qt\include\QtGui
c:\Qt\qt\include
c:\Qt\qt\include\ActiveQt
debug
c:\Qt\qt\mkspecs\win32-msvc2008
Additional Library Directories
c:\Qt\qt\lib
Additional Dependencies
c:\Qt\qt\lib\qtmaind.lib
c:\Qt\qt\lib\QtGuid4.lib
c:\Qt\qt\lib\QtCored4.lib
However, when I browse to the directory c:\Qt\qt\lib all I have is:
qtmain.prl and qtmaind.prl
However, I don't have qtmaind.lib or qtmain.lib
Many thanks for any suggestions,
Are you sure you are using the correct QMAKESPEC?
I would think you would need to use wince*-msvc2008
See Qt: Supported Platforms
Open the Visual Studio command prompt (you can find a shortcut in the start menu). It has all the appropriate environment variables set. Go to C:\Qt\20****\qt. Type configure and then nmake.
Did you download the source distribution? If so you would need to compile Qt before you get the libs.
See:
http://doc.qtsoftware.com/4.5/install-win.html
http://doc.qtsoftware.com/4.5/install-wince.html
My commercial version comes precompiled. If I remember correctly, when I used the open source version I needed to compile everything myself.
First you have to configure the Qt to your machine to get the libs! It will takes several minutes. Follow the steps in: http://portfolio.delinkx.com/files/Qt.pdf
in properties -> linker -> input
remove ANY path for qt libraries such qtmaind.lib
sometime you need remove :
/SUBSYSTEM:WINDOWS%40QMAKE_SUBSYSTEM_SUFFIX%40) from the VS project (under Properties --> Linker --> Command Line).
this is known BUG in VS addin

Resources