Few days ago i create static-library (Universal) that work's fine with Xcode5.0 SDK7
. After Update Xcode5.1
with SDK7.1
that not work if i select simulator iPhone Retina(4-inch 64-bit)
. Then i am going to update my lib with Bellow setting change.
I do the same for three Target:-
For sporting simulator as well as device i put Universal lib and in to this i run script this:-
After this i Build Again lib and used as i done Before in to my project. But still getting same issue with iPhone Retina(4-inch 64-bit)
Undefined symbols for architecture x86_64:
So, My question is that is there any additional change required for updating lib for arm64 or i did any mistake in above step. Please current me if i am wrong.
what change needed for update my static-library for supporting 64Bit architecture
NOTE:
I am asking for my own created Library Update. i am not using third-party Library. Update
I used this lipo -info testingLibImport/libLibNSlog.a
command in to my Terminal that output is:
Architectures in the fat file: testingLibImport/libLibNSlog.a are: armv7 armv7s i386 arm64
I too ran into the same problem yesterday and after lot of googling and trying on different solutions, i gave up and tried on my own. All i could understand from the different solutions provided was that when i run "lipo -info library.a" it was not built for x86_64 architecture. So, decided to give up the aggregate approach and made a simple attempt.
lipo command: lipo -create -output newlibraryname.a simulatorlibraryname.a devicelibraryname.a
integrated the newly created universal static library and it WORKED!!!
Another solution I found with XCode 6.4 is to add ONLY_ACTIVE_ARCH=NO and not specify the architecture. So
Will build i386 and x86_64 architectures in your library.
Here's my full universal lib run script to build all the architectures.
After lots of stuff i got solution. some of xcode dont know there is automatic appear
Standard architectures (including 64-bit) (armv7,armv7s,arm64)
but in my case there is not option into my Static Library Project. so i am going to add this Manually like:-and select this Option:-
After this i re-Build My static Library and used in to in my project that working fine now. and I also checked with lipo command in to terminal that output going to different now:-
testingLibImport/libLibNSlog.a are: armv7 armv7s i386 x86_64 arm64
Sorry for posting another solution so late. I had found this solution long time back when i was trying to find a solution that would save me from the manual work of creating a universal library using lipo command every time i had to build the universal library.
So, here is the another approach, for those using aggregate approach to build the universal library
just make one small change as mentioned below in your aggregate script for simulator to build the universal library -
xcodebuild -target ProductName -configuration ${CONFIGURATION} -sdk iphonesimulator ARCHS="i386 x86_64" BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" SYMROOT="${SYMROOT}"
Please observe the inclusion of multiple architectures instead of using single architecture approach -
xcodebuild -target ProductName -configuration ${CONFIGURATION} -sdk iphonesimulator -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" SYMROOT="${SYMROOT}"
Just ARCHS="i386 x86_64" will do the magic for you.
You can confirm this by using the following lipo command lipo -info newLibraryName.a
Hope this saves time for many others like me!!!