Sudden Warning on XCode 5.1 - ios

I suddenly started getting this error after upgrading my Xcode 5.0.2 to Xcode 5.1
warning: ignoring debug info with an invalid version (0)
There are like 22 of these warnings coming up when compiling my code...
I haven't encountered anything like this beforeā€¦ Please can anyone help.. thanks in advance..

In XCode target BuildSettings, search DEAD_CODE_STRIPPING and set Value to NO.
This is a bug with LTO and -dead_strip. The workaround is to stop using one of them.
way Link Time Optimization (LTO) works is that the compiler stops half way through and emits the .o file as "bit code" (the internal clang IR) instead of compiling down to mach-o. This is drive by the -flto compiler option. When the linker encounters bit-code .o files, it loads up the back end of clang (libLTO.dylib) and merges/compiles all the bit-code files into mach-o then completes the link.
The Link

Check files that are related to warnings. If will be probably a third party library. Try to recompile that lib with new Xcode.

Related

How do I resolve linker warning "ignoring linker optimzation hint at" in XCode?

A google search for "ignoring linker optimzation hint" practically turns up nothing. NOTE: "optimzation" is the exact spelling :)
I'm using a 3rd party WebRTC library (libjingle_peerconnection) from Pristine in one of my apps and I get warnings when I build for my iPhone 6. I'm not sure if this warning will pop up for other devices, however, it does not appear when I build for the simulator.
I have exactly 68 of these bad boys in my build output:
ld: warning: ignoring linker optimzation hint at _cftmdl_128_neon+0xF0 because ldrInfoC.offset == 0
I'm not sure if I should notify the maintainers or if this is something I can resolve myself.
If you're compiling the WebRTC library by yourself using build scripts, the warnings are generated because of a missing parameter in GYP_DEFINES.
In order to fix the warnings, the WebRTC library needs to be compiled again with the parameter clang_xcode=1 in the GYP_DEFINES setting, like below (only an example):
export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=arm64 clang_xcode=1"
More about the issue can be found here, on the Chromium forums:
https://bugs.chromium.org/p/webrtc/issues/detail?id=5182
--
If you're not compiling the WebRTC library yourself, and instead installing the WebRTC library from a 3rd party source, I don't believe there is a fix as the warnings are stemming from the static library.

Compiling error using llvm clang in iOS (on device,jailbreaken)

how can I fix this error?:
http://i.stack.imgur.com/zmZea.jpg
I got this error when compiling a simple c++ file but I don't know why
When I compile this file with iOS 6.1 sdk it works but I want it to work in iOS sdk 8.1
My iPad:ipad 3 wifi
My iOS version:8.4
It shouldn't be problem with the architecture. As far as I know Apple hasn't changed Armv7. From what I see, its a linker error, probably caused by libraries not being linked in correctly. Pretty clear when it says: ignoring nonexistent library. This type of error could occur if you import a header and fail to link it against the correct library OR if you just straight up include a header for the wrong architecture -_-.
So thats the diagnosis. I guess the rest of the hacking is up to you since no one here has any clue what you have done to the poor iPad.

xcode LLVM 5.1 clang error

I am having no luck the last few days since Xcode 5.1 came out.
I keep getting this error on an old project that supports iOS 6.0:
ERROR:
clang: error: unknown argument: '-fno-obj-arc' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
There are not many posts about this on the internet and some suggestions seem to be to change your CFLAGS but I have no idea how to do that in Xcode.
Apple suggests this from their documents:
Compiler
As of Apple LLVM compiler version 5.1 (clang-502) and later, the
optimization level -O4 no longer implies link time optimization (LTO).
In order to build with LTO explicitly use the -flto option in addition
to the optimization level flag. (15633276) The Apple LLVM compiler in
Xcode 5.1 treats unrecognized command-line options as errors. This
issue has been seen when building both Python native extensions and
Ruby Gems, where some invalid compiler options are currently
specified. Projects using invalid compiler options will need to be
changed to remove those options. To help ease that transition, the
compiler will temporarily accept an option to downgrade the error to a
warning:
-Wno-error=unused-command-line-argument-hard-error-in-future
Note: This option will not be supported in the future. To workaround
this issue, set the ARCHFLAGS environment variable to downgrade the
error to a warning. For example, you can install a Python native
extension with:
$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install ExtensionName
Similarly, you can install a Ruby Gem with:
$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName 16214764 updated
How do I get this workaround? Obviously Apple has messed up because it should only be presenting me with a warning and not an error according to their documents.
Any help would be greatly appreciated. I can not build my app until this issue is rectified.
There is no such thing as -fno-obj-arc. This never was working correctly; you just weren't seeing the warnings. The correct form is -fno-objc-arc.
EDIT (appended info drawn from my comments below): This is not a clang error. It is an error in the project; clang is merely reporting it. The project itself wrongly contains the -fno-obj-arc argument, probably in the Compile Sources build phase of the target (as described here: How can I disable ARC for a single file in a project?). It is easy to type the setting incorrectly; what has changed in Xcode 5.1 is merely that clang is now calling the problem to your attention. Thus, as I said before, this never was working correctly; you presumably intended to turn off ARC for certain files, but you were failing to do so, as the build argument was incorrectly entered.
Update to xcode now throws unknown compiler flags as hard errors rather than warnings. Found this to be helpful:
https://langui.sh/2014/03/10/wunused-command-line-argument-hard-error-in-future-is-a-harsh-mistress/
I figured out with a small bit of help from matt.
I was trying to figure out where to change the -fno-obj-arc and NO ONE answered that question.
I found this link to be helpful...
http://blog.evanmulawski.com/?p=36
Once you select build phases and compile sources, you can look next to the files in your project and change their build flags.
Thanks for the attempt guys.
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
You need to change -fno-obj-arc to -fno-objc-arc.
Select project -> targets -> build phases ..see picture

Apple Mach-0 linker warning

I'm fairly new to ios programming. I've got an app that I think is almost ready for the appstore. However, I have one remaining warning and I'm not sure how to track down where the problem lies.
Here's the warning:
(null): Ignoring file /Users/maclehose/Library/Developer/Xcode/DerivedData/epidemiologyCalculator-esumevitgvkrmsfrmqeerqjyjfoh/Build/Products/Debug-iphoneos/epidemiologyCalculator.app/epidemiologyCalculator, missing required architecture arm64 in file /Users/maclehose/Library/Developer/Xcode/DerivedData/epidemiologyCalculator-esumevitgvkrmsfrmqeerqjyjfoh/Build/Products/Debug-iphoneos/epidemiologyCalculator.app/epidemiologyCalculator (2 slices)
Can anyone give me any specific advice on how to track down the source of the warning?
Thanks,
Rich
Go to targets and then Build Settings. Then turn the architectures to (armv7, armv7s). Like this you can silence the warning.
But then when you change it like this, it means that your app doesn't gets compiled for the 64-Bit architecture (iPhone 5S uses it).
You don't need 64-bit setting, if performance is not an issue. However if you really need it, you'll need to compile and build CorePlot library from source by adding it as a dependent project inside your app.

Error in generating Archives

I m using Xcode 4.2 and i have add AviarySDK 2.4.4 in my project.
Application runs fine in Simulator 5.0 and 4.3. I also test it on device having ios 4.1. So i want to generate .ipa file for my client. But by some reason it can not generate Archives.
It gives following error
"/usr/bin/strip -S /Applications/Projects/AppName/AppName/AviarySDK/Resources/AviarySDKResources.bundle/AviarySDKResources -o /Users/User/Library/Developer/Xcode/DerivedData/WDYWT-avjpbcnwjylobvgevipvsqttnopd/ArchiveIntermediates/WDYWT/InstallationBuildProductsLocation/Applications/WDYWT.app/AviarySDKResources.bundle/AviarySDKResources
/usr/bin/strip: for architecture armv7 object: /Applications/Projects/AppName/AppName/AviarySDK/Resources/AviarySDKResources.bundle/AviarySDKResources malformed object (unknown load command 10)
error: strip /Applications/Projects/AppName/AppName/AviarySDK/Resources/AviarySDKResources.bundle/AviarySDKResources: /usr/bin/strip exited with 1
"
Any help will really great. Many thanks in advance.
Strip errors are generally caused if you have duplicate debugging symbols in your project. Just try the following:
First Method:
Go to build settings of your project
Type Strip in the search Bar.
Under Strip Debug Symbols During Copy, you shall find Debug and under that you shall find Any SDK.
Select NO in Any SDK, select YES in Debug and select YES in Strip Debug Symbols during copy.
A little below you shall find Use Separate Strip. Select YES.
Check that Strip Style should remain All Symbols [If not then change it to that].
Second Method:
Since your error also mentions derived data, their might me duplicacy of your derived data as well. Delete Your project file from the derived data folder.
If you don't know where the derived data folder is, Google it.
I am using aviary in my current project. I have a Mac Mini and a MacAir [for work at home].
I was facing the same strip issues with aviary which I resolved using the first method mentioned above.
It took me a week to figure this out cuz i am a relative newbie in development and nothing regarding this issue has been mentioned in aviary forums as well.
PS:
MacMini: Xcode 4.5
MacAir: Xcode 4.2
Hope this helps

Resources