What is difference between libxml2.dylib and libxml2.2.dylib in iOS - ios

Currently I am using libxml2.dylib to parse XML now I want to shift to libxml2.2.dylib. Then, what kind of changes I would do in configuration and coding?

Xcode 4.5 (and the iOS6 SDK for that matters, because the libraries available are dependent of the SDK, not the Xcode version) still has libxml2.2.dylib.
You should generally not link your application with a specific version of libraries like that, but better with a generic version like libxml2.dylib or libxml2.2.dylib.
but for the better result in ios6 libxml2.2.dylib. is used.Sometimes you will get linking errors or some unusual errors with lower version
If you want to know the difference
then follow this link-
iOS6 does not have libxml2.2.7.3.dylib.are there any substitutes?

if you are getting linking errors then you should add /usr/include/libxml2 is in your Header Search Paths in your Debug/Release configuration

Related

Lexical or preprocessor issue in react native while building ios app <React/RCTUtils.h> not found

When I am trying to build my ios app in xcode, the build is failing due to lexical or preprocessor issue the error shows up like this
This was a problem specific to the react-native-device-info module.
For your specific case you may try v1.6.1 or higher (currently at 2.0 as of May 21, 2019) of the library and that should fix things for you.
For others interested more generally in the problem, this is a react-native library that uses native code, so it has an XCode project embedded within it for use in react-native after you run react-native link react-native-device-info. Unfortunately, the library was not including any directories in it's header search path, so it was of course unable to find the header files for the react-native objects it was using locally.
A library user proposed a change that fixed that problem for tvOS, and I extended the change to cover iOS as well, and now the library no longer generates errors like this for iOS or tvOS targets.
Perhaps someone with a similar issue may find the specific changes required for the fix useful in their projects

make Xcode build fail or at least warning if I use methods from "future" SDK version, relative to Target SDK version [duplicate]

Is there a way to have Xcode tell me when I'm calling a method that isn't available in the SDK of the minimum supported target?
For example, the method [NSURLConnection sendAsynchronousRequest:queue:completionHandler:]. This method is available on iOS5 and up. But my application's minimum target is iOS4.
If I use that method (sendAsync), I'd like Xcode to tell me that that method isn't available for the minimum target I'm trying to support.
I've tried putting __IPHONE_OS_VERSION_MAX_ALLOWED=40000 in the preprocessor settings, but that just triggers a bunch of Apple SDK errors that aren't helpful. (Probably because my active SDK is iOS5.1)
Is the only solution to get ahold of old SDKs and install them in Xcode?
Are there any easier solutions?
There is unfortunately no standard way of doing this. By setting the target OS to a lower number than the base SDK, Xcode will weakly link the libraries and frameworks. When doing that Xcode will not warn you for using methods that may not be available on the target OS.
You could temporarily set the base SDK lower, but that might not always work. Since you want to ignore most of the errors and warnings produced (because they are only called conditionally in your code path), and many warnings and errors are dependant on other error that you may need to resolve before the compiler will give any meaningful output.
I do not think there exist any static analysis tools for this, neither from Apple nor third party.
After doing some research, reading the Apple Doc about it, and trying a number of things. The solution is downloading an old Xcode DMG from Apple, grab the .pkg file for the same SDK as your deployment target and install it in your version of Xcode. Here's how:
Download older Xcode.dmg from Apple
Open the DMG
In Terminal, go into packages: "cd /Volumes/[DMG]/Packages; open ."
Find the SDK you want, something like iPhoneSDK_4.0.pkg
Install that package, but change the install directory to /Applications/Xcode/Contents/Developer
Restart Xcode if it was open.
Now that you have the same SDK as your deployment target, set your BaseSDK to the same. When you build you'll get warnings about missing methods. Your project may or may not successfully build with an older BaseSDK in a new version of Xcode, but that doesn't matter - you've just found the method calls you need to wrap in a feature check with respondsToSelector:.
As of Xcode 7.3, the compiler can now generate these warnings for you. All you need to do is set the -Wpartial-availability warning flag in the Build Settings, as described in this answer.

Compiling cocos2d-iphone v2.x including arm64

An error occurs when compiling cocos2d-iphone v2.x and including arm64 architecture. The error is in the assembly code for kazmath. Is there a fix for this? (other than removing arm64)
libs/kazmath/src/neon_matrix_impl.c:
Unknown register name 'q0' in asm
Well, maybe no big deal... would be nice to support iPhone 5s etc fully with existing code.
I guess this is fixed or will be fixed in the cocos2d 3.x line. https://github.com/cocos2d/cocos2d-iphone/issues/534
Correct, cocos2d-iphone v3 does build successfully for the arm64 architecture, v2.x does not.
Even though the compiler warnings/errors are relatively easy to fix, there are a number of 64-bit compatibility issues that remain in v2.x (like CGFloat vs float mismatches and others) which means it's not recommended to enable arm64 builds for v2.x unless you're prepared to debug and fix these issues yourself. More so if you use 3rd party extensions which haven't been tested with arm64 either, for example anything in the cocos2d-iphone-extensions project.
Since currently no one is assigned to work on the v2.x branch and I don't expect v2.x to receive any future updates at all it's probably best to not include arm64 code (not much to gain anyway). Then start your next project with cocos2d-iphone v3.
I also had this problem in my one of old projects with Cocos2d.
I've downloaded Cocos2d v3, and copied the "kazmath" folder only to my older project, and replaced them.
If you don't want to change all the files, change :
#if defined(__ARM_NEON__)
into
#if defined(_ARM_ARCH_7)
By the way, I'm trying to update fully to the Cocos2d v3, and I think that is the right solution for this. even though my problem is handled, it is still problematic in general.
Cocos2D 2.2 now has 64 bit support!
You can download version 2.2 form here.
Upgrade your karmath library with cocos2D v3 kazmath lib (https://github.com/cocos2d/cocos2d-iphone/tree/develop-v3/external/kazmath).
It works for me (on iPad Air)
I solved in this way:
Downloading Cocos2D 2.2 here as suggested by #appzYourLife
Replaced folders cocos2d and CocosDenshion inside xcode project folder with folders of version 2.2
In folder kazmath/src edit mad4.c and neon_matrix_impl.c and replace line:
#if defined(__ARM_NEON__)
with
#if defined(_ARM_ARCH_7)

Using iOS 7 SDK with llvm-gcc-4.2

I've installed xcode 5 and noticed that gcc compiler is deprecated. Assuming that I don't want to switch to Apple LLVM 5.0, here come my questions:
Is it possible to use iOS7 SDK and still compile in llvm-gcc-4.2?
If yes, how to do this?
If you don't know if that's possible, please don't post answers like "use clang, man", because they are not actually answering the questions I've posted.
Apple has removed the support for llvm-gcc-4.2 in XCode 5. Even if you install and change your base sdk to 6.1 sdk, you won't be able to build using llvm-gcc-4.2. So your only option is to continue using XCode 4.x if you want to use llvm-gcc-4.2.
LLVM-GCC is not included in Xcode 5.
I got above line from
https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_5_0.html
So the question is what to use instead of llvm-gcc ?
Is it possible to use iOS7 SDK and still compile in llvm-gcc-4.2?
If you want to compile your whole app using llvm-gcc-4.2: Probably not. I haven't checked this myself, but the iOS 7 headers would only need to add a single dependency on a clang feature missing in llvm-gcc-4.2 and you're swimming in compile errors. You may be able to hack your way through them, but it would likely be easier (not to mention more future-proof) to suck it up and upgrade to clang.
If you only need to compile some of your app using llvm-gcc-4.2: Sure, as long as you don't need to import any iOS 7 headers in the parts that you build with llvm-gcc-4.2.
You could try moving the problematic bits off to a static library, compiling that with gcc, then linking in to the final app, built with clang. You won't be able to target 64-bit, as llvm-gcc-4.2 doesn't can't generate armv8 code, but it should work otherwise.
One caveat: If your static lib uses C++, there may be some problems due to ABI and std library differences. But those are solvable problems, at least.
You could use homebrew to install the gcc version you need. Most probably all your Makefiles will need to be corrected (sigh)
I did:
brew search gcc
And the results:
homebrew/versions/gcc43
homebrew/versions/gcc45
homebrew/versions/gcc47
homebrew/versions/gcc49
homebrew/versions/gcc44
homebrew/versions/gcc45
homebrew/versions/gcc48
homebrew/versions/llvm-gcc28
homebrew/dupes/apple-gcc42

Flex ANE, iOS and ARC

Good day
I have created a static library with Xcode. Then I compiled my ANE using adobe's ADT tool. Thereafter I've included the ANE in my FlashBuilder project. However, when attempting to package my project, I get the following error:
"Error occurred while packaging the application:
Undefined Symbols: "_obj_storeStrong", referenced from ...
.
"_obj_release", referenced from ...
.
"
My guess is that ARC is probably not supported for ANE's. I'm guessing that this is probably due to the fact that FlashBuilder is recompiling the entire AIR + the native libs into one iOS application, probably using their own compiler or something (which is why Air apps for iOS can be compiled on windows platforms as well), and this compiler is probably not 4.3 ready yet?
I have attempted adding the flag -fobjc-arc to my ios-platformoptions.xml as well (where this file is the parameter to the -platformoptions flag of adt), but still no joy. It results once again in an error when packaging. Perhaps any other flag I can try to use here?
Any corrections, suggestions, alternative ideas or comments will be most welcome. I am very new to Xcode, Objective C and ANE, so please excuse any incorrect statements or assumptions, and please correct me on these.
I would be glad if somebody can please confirm weather I am correct with my assumption that I cannot use ARC at this stage on ANE's.
Thanks
Christo
START EDIT:
Very late update, sorry.
You might be able to use ARC after all. There is a library called arc lite that I forgot to mention and it works. I created an ANE for MapKit on iOS targeting the 5.0.x SDK. When I tried to move to a device that only had 4.3.x ( could have been 4.3.3 or 4.3.5 ) the app crashed or would not compile. I found information on the arc lite library that is included in the newer sdks, followed the instructions on how to include this library and pow! A working ANE on a 4.3.x device without rewriting my code!
Hope all of this helps and half of my original comment :)
Markus
END EDIT
I don't think ARC is supported just yet. There isn't much to go on in terms of settings or examples of what the settings should be in Xcode. Take a look at any of the Xcode ANE projects you can get your hands on. You will see that most or all of the projects have:
Object-C Automatice Reference counting = NO
Objective-C++ Automatic Reference counting = NO
Take a look at the following:
Vibration ANE - On Adobe Devnet site
Liquid Photo - http://www.liquid-photo.com/2011/10/30/common-native-extension-issues/
Liquid Photo - http://www.liquid-photo.com/2011/10/28/native-extension-for-adobe-air-and-ios-101/
There are a lot of examples in Github but you have to find them via Google. Pull down the Xcode ANE projects and compare the settings.
Hope this helps!!!
Markus

Resources