mach-o-liinker error in xcode 5 upgrade - ios

I upgraded to xcode 5 recently. When I try to run my app that is already working with xcode 4.6, i get this error:
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/InterfaceBuilderKit.framework/InterfaceBuilderKit' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Anyone know of a way to fix this?

This issue cause from your target setting that has been added automatically in Xcode 5.0
Try these
in your project target look for "Search Paths"->"Framework Search Paths" make sure the value for the field is empty.
in your project target look for "Linking"->"Other linker Flags" make sure the value is empty.
Hope it help

Related

Xcode Linker issues

Im writing to you as I am deeply in need of some assistance.
I'm trying to compile an app to my iPhone from Xcode, however, I keep encountering the issue of having this error come up when I press run:
ld: warning: directory not found for option '-F2'
ld: '/Users/[My-name]/Documents/XCode Projects/Store Testing Projects Here/BallGame 1.1/StartApp.framework/StartApp(STAJsonAd.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Now, I have checked and made sure that both my framework search paths and Library search paths are both empty. This is why I am having such an issue, I cannot for the life of me figure out the issue here! Why is Xcode trying to link something that is not specified to link to!
Thanks in advance, cheers.
Do you have more than one TARGETS?
You can change the value in Build Settings→Build Options→Enable BitCode to NO.

Unit test case fails in xcode

When I run my unit test cases in xcode 6.3 it gives me an error saying
ld: building for iOS Simulator, but linking against dylib built for
MacOSX file
'/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest'
for architecture i386 clang: error: linker command failed with exit
code 1 (use -v to see invocation).
The unit tests are working in the developer system but not in my server mac machine. Please help me out.
Finally found it out myself. It's a bug in xcode. Just uninstall xcode and remove files in path ~/Library/Developer/Xcode . Then reinstall xcode and the error is gone.

xcode compilation errors after xcode 6 update

Since I upgraded to xcode 6 my project do not compile anymore, I cleaned several time, restarted, deleted the derived data but it didn't help
So I went back to xcode 5 and I also have errors now on xcode 5
My project is a working project from the repository and it's working on my colleague's mac...
I didn't change anything so I don't understand and will aprreciate any help
the errors
error: unable to open executable '/Users/mobiledev/Library/Developer/Xcode/DerivedData/MyApp-bqkgvjwrncaywqgcyydyxfwxsvio/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp'
ld: framework not found AVKit for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Had the same trouble, I've just set the target membership in File Inspector of my framework.
Find AVKit framework in your project and try my method, may be it will help.

ld: file not found: -Obj-C error when building a new XCode project using embeded Cordova webview

I am trying to create a basic iOS app with Cordova webview. I followed the cordova instructions for iOS webView. Specifically step 11 asked me to these two option into other linker flags field in the target:
-force_load
-Obj-C
When I try to buid the project I get the following error at the end:
ld: file not found: -Obj-C
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am pretty new to iOS, but to me it looks as linker thinks I am passing it a path as opposed to an option. Is this due to changes in XCode or am I doing something wrong? I am using the latest (v5.0.2) of xcode. I'd appreciate any help.
Edit: I found a workaround
My goal was to start an xcode project with a cordova webview. Actually when we create a new app with cordova command line tool and add the ios platform to it, cordova will also generate an xcode project for us. When I open the project I can edit the MainViewContorller.m or add other libraries or SDKs to the project. So my problem has been solved.
I am still curious as why the instructions in the official documentation did not work. If you know why, feel free to share.
It works just by deleting option
-force_load
and replacing option
-Obj-C with -ObjC
Linker flag should be -ObjC, not -Obj-C

iOS - Can't Build on Device but Simulator on Xcode 4.6

I'm now using Xcode 4.6 but cannot build my app on a device but perfectly working on simulator. It is looking my lbxml2, I already followed the solutions given by other users like adding "${SDK_DIR}/usr/include/libxml2" to Header Search Paths under Build Setting, include in Link Binary With Libraries under Build Phases but still no luck.
Before I switched to Xcode 4.6, it was building on Xcode 4.5. So, I really don't know what is wrong.
Thanks!
EDIT:
I am getting this error:
ld: library not found for -lxml2
clang-real++: error: linker command failed with exit code 1 (use -v to see invocation)
Command /Applications/Xcode 4.6/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ failed with exit code 1
How are you trying to link your library in?
A "-lxml2" line in your build settings?
When I add my dylibs to my project, I usually do it the way you see in my screenshot.
Try this and see if it works for you also:

Resources