lipo -info libXxxx.a
Architectures in the fat file: libXxxx.a are: armv7 i386 arm64
But compiler in the dependant project is giving linking error,
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ClassXXXX", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Am I missing something?
All the lib project's target have Architectures: Standard Architectures (armv7, arm64)
and Valid Architectures arm64, armv7, armv7s
in my lipo command while making universal binary I am lipo-ing both from iphonesimulator and iphoneos folder.
Your main clue is that it says "symbol(s) not found for architecture x86_64" instead of "symbol(s) not found for architecture i386".
The fix is to tweak your build settings to allow a 32-bit build.
1) Select your project file in the Project Navigator (the left sidebar)
2) Select your project's target (first entry under TARGETS in the panel that just came up)
3) Find the "Architectures" setting (make sure "All" is selected if you can't find "Architectures")
4) Change it from "Standard Architectures" to "Universal" (or explicitly "32-bit" if you prefer)
You should be able to build after doing this.
You need to create a universal binary including following architectures in your static library project. The architectures should be including 64-bit, armv7, armv7s, arm64.
Now when you do a lipo -info anyStaticLibrary.a on terminal - you should see armv7 armv7s i386 x86_64 arm64 architectures for your fat binary.
Also note that the project which uses the above static library can work fine with the default settings of the architectures.
Related
I created a static library (XXX.a) (which has 3 static libraries inside(aaa.a, bbb.a, ccc.a)) and added it into a pre-developed project (someonesProject). When I lipo -info to XXX.a I see the following architectures: armv7, i386, x86_64, arm64
When I try to run this project, I receive an error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_aaa", referenced from:
objc-class-ref in XXX.a(XXX.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I remove arm64 from the valid-architectures (arm64, armv7 armv7s) of the project (someonesProject), then I can run the app.
How can I fix this issue, I want to make this project work without removing arm64?
I really need help.
Thanks
E.
All your static libraries have to be compatible with arm64 if you want to compile your project with this architecture.
So I guess at least one of aaa.a, bbb.a and ccc.a is not compatible with arm64.
I have an issue when trying to use an external lib : I can't compile the project as it throws an exception as below.
ld: warning: ignoring file /Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimshop_SDK.a, missing required architecture x86_64 in file /Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimshop_SDK.a (3 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_StimshopSDK", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)`
I tried lots of solutions found on stackoverflow (but for XCode 5.1 and not as well explained) without any change ...
I also found this topic XCode 6.1 Missing required architecture X86_64 in file that exactly correspond to my problem and
when looking at my lib's architecture with lipo -info command, it seems it's missing i386 and x86_64. How could I add them to my library architectures to be able compile ?
This means your .a library doesn't contain the x86_64 architecture (You can run lipo -info /path/to/your/lib.a to verify it). If you don't have the source code of the library, you have to modify your own project. In the build settings, change the valid architectures to armv7 and i386, or change Architectures to armv7 only. However, by doing so, your project won't be compiled to the arm64 architecture, which is required when uploading to the App Store after Feb 2015, according to Apple's announcement.
If your library doesn't contain x86_64 architecture, it is likely that it doesn't contain arm64 either. So you should avoid using old libraries.
If a library doesn't have the X86_64 architecture you can build it if you've picked a connected device rather than a simulator for your build target.
Basically, you can still build and develop but you can't use the simulator.
Click on your project > build setting > architecture. Change architecture as armv7 and delete others like armv6,etc, Then it will work :-
In the project that builds libStimshop_SDK.a, be sure the "Architectures" setting is set to $(ARCHS_STANDARD) and that it includes 64-bit settings in the compiler settings. Be sure the "Valid Architectures" setting includes 64-bit as well.
I am getting this error while building my iOS app.
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv7, VALID_ARCHS=armv6 i386).
I am followings errors while I am trying to use _ACAccountTypeIdentifierTwitter:
Undefined symbols for architecture armv7s:
"_ACAccountTypeIdentifierTwitter", referenced from:
-[ClsHomePageViewController twitterLogin:] in ClsHomePageViewController.o
"_OBJC_CLASS_$_ACAccountStore", referenced from:
objc-class-ref in ClsHomePageViewController.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And my Architecture settings are as follows:
architectures: Standard Architectures (including 64-bit) (armv7,armv7s,armv64)
Base SDK: Latest iOS (iOS 7.0)
Build Active Architecture Only: NO
Valid Architectures: arm64 armv7s armv7
Go to your project, open Project (not target) ->Build Settings and set Build Active Architecture Only to NO:
1.Please check your project Architectures.
You can find about architectures follow this:
From your target - Build Settings - Architectures, see the screenshot.
2.The Build Active Architecture Only the following Debug is set to YES.
Reference:iOS currently has the following instruction set:
(1). armv6, support machines iPhone, iPhone2, iPhone3G and the corresponding iTouch
(2). armv7, support machines iPhone4, iPhone4S
(3). armv7s, support machines iPhone5, iPhone5C
(4). arm64, support machines: iPhone5S
You can add armv7 in you valid architecture list.
I'm adding the Testflight SDK to my iOS project, but now I can't build the IPA for it.
The error I have is
ld: warning: ignoring file /Users/RM/Dropbox/SAM_iOS/mainApp/SAM/TestFlightSDK2/libTestFlight.a, missing required architecture arm64 in file /Users/RM/Dropbox/SAM_iOS/mainApp/SAM/TestFlightSDK2/libTestFlight.a (3 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_TestFlight", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've followed (three times) the steps detailed here, but the error keeps appearing.
Any help is appreciated!
The 2.0.2 version of the TestFlight library does not support arm64.
You can either remove the arm64 from your project and targets or use the 2.1 beta library which has support for arm64
You can check which architectures are included in the a library using the lipo tool in Terminal:
lipo -info <path to library>
Running this on version 2.0.2 of the library, shows that it does not include the arm64 architecture:
Architectures in the fat file: libTestFlight.a are: armv7 armv7s i386
Running the same on the 2.1.3 beta:
Architectures in the fat file: libTestFlight.a are: armv7 armv7s i386 x86_64 arm64
We've implemented a static library and trying to use it on the project. The library is compiled/build well but as we try to run the project after importing .a & .h files respectively, we encountered with following error :
ld: warning: ignoring file Lib.a, file was built for archive which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MFourInOneStaticLib", referenced from:
objc-class-ref in MAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've already checked the architecture.More-over, we're using the simulator for the testing purpose.
well looks the your lib doesnt contain the right architecture.
for ios you need armv7 and for the simulator you need i386
to test it
lipo -info %NAME%
often a lipo is only built for EITHER arm OR x86
built it for both archs and then combine the two files
lipo ./build/Release-iphoneos/%NAME% ./build/Release-iphonesimulator/%NAME% -output ./Dist/lib/%NAME% -create