error: library not found for -lUAirship-1.3.3 - xcode4

For adding push notifications functionality to my iphone app I use Urban Airship, but the build failed with this error:
ld: library not found for -lUAirship-1.3.3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
what should I do?
thanks!

IUAirship-1.3.3 needs to be loaded into your project.
Drag IUAirship-1.3.3 into your project. (be sure to check off the option: Copy items into destination group's folder).
Also be sure to link it to your framework by:
Selecting the Target, Click the general tab (at the top), scroll to Linked Frameworks and Libraries, click the + button, add IUAirship-1.3.3
Clean and build:
Next under the Project Menu, select clean. Try building it now. It should be found.
Hope this helps.

Related

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.

Unknown option: -bitcode_verify

So, I managed to get my iOS App and WatchKit app running fine but when I (first clean) run Archive, the compiler throws the following error:
ld: unknown option: -bitcode_verify
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It relates to the WatchKit Extension but I'm completely blank on where to start.
(Xcode 7.0.1 / Deployment target iOS 8.2 / WatchOS 2.0)
Thanks again!
/Frederik
When I realized the only thing left to do was to create a brand new project and start copy pasting, I created a new iOS project and added a WatchKit target. Without adding any code I tried to build and archive the project and I got the same compiler error which led me to the conclusion that the problem laid with Xcode itself. After a complete uninstall (all associated files removed) and then a new install, voila! It compiles normally.

Warning while building project using Qt 5.1 on OSX

I am getting two warnings while trying to build Qt projects on Mac (using QtCreator).
warning: No .qmake.cache is present. This significantly slows down
qmake with this makespec. warning: Call 'cache()' in the top-level
project file to rectify this problem.
The warning instructs to call cache() in the top level project, but I don't find any documentation on how I should do that.
I see some bugs logged on qt
https://bugreports.qt.io/browse/QTBUG-31340
https://bugreports.qt.io/browse/QTBUG-30586
I know this is just a warning, but I am interested in fixing it. Is there any workaround to fix it?
The solution is to call cache() in your main .pro file.
Then run qmake (from the QtCreator build menu) and rebuild the project.
The warning should be gone.
Example .pro:
cache()
QT += ...
//the rest of the .pro file

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"

PLCrashReporter in XCode 4 - won't compile in Simulator

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".

Resources