This is the warning message appears when I compile my WatchKit 2 app
ignoring file
/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.1.sdk/System/Library/Frameworks//WatchKit.framework/WatchKit,
file was built for i386 which is not the architecture being linked
(x86_64):
/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.1.sdk/System/Library/Frameworks//WatchKit.framework/WatchKitld:
warning: ignoring file
/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.1.sdk/System/Library/Frameworks//Foundation.framework/Foundation,
file was built for i386 which is not the architecture being linked
(x86_64):
/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.1.sdk/System/Library/Frameworks//Foundation.framework/Foundation
And, finally, it failed to compile
ld: entry point (_main) undefined. for architecture x86_64
Architecture allowance in build setting is : i386 and x86_64.
However, if I force architecture to x86_64 only (which I dont want to apply for my project forever). There is another error
ld: illegal text-relocation to 'non_lazy_ptr' in
And I added OTHER_CFLAGS = $(inherited) -read_only_relocs suppress as recommended from some answers in stackoverflow.
But Xcode kept the same error message.
Edited: oh, my another mistake. This should be OTHER_LDFLAGS =... something.
Could any one give me any ideal how to overcome this.
Many thanks,
I figured out the problem.
Because I mistakenly set my WatchKit extension's architecture for WatchSimulator be i386 x86_64. Xcode automatically selected x86_64.
However, Watch Simulator SDK does not support x86_64. Because all current watch OS is built only for 32-bit architecture.
After I removed x86_64 from the architecture setting, Xcode builds my target with i386 architecture.
Then the warning and error disappeared.
Many thanks,
Related
I am trying to include MumbleKit as a library instead of having to compile it each time by following the suggestion of a member of this forum. Yet when I try to compile on the simulator I get:
missing required architecture x86_64 in …libMumbleKit.a (3 slices)
I think I added all the necessary versions to MumbleKit before generating the library:
arm64 armv7 armv7s armv7k arm7s x86_64 i386
notwithstanding, when I execute:
lipo -info libMumbleKit.a
I get:
Architectures in the fat file: libMumbleKit.a are: armv7 armv7s arm64
as well as configuring Build Active Architecture to NO.
I generated the library for MumbleKit both using the Generic iOS device and a iOS 9 physical device.
When I try to archive using the Generic iOS Device option after having extracted the Mumble library in the same way, I instead get error:
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(CryptState.o)' was
built without full bitcode. All object files and libraries for bitcode
must be generated from Xcode Archive or Install build for architecture
armv7
Same when using my physical device after also generating the library in the correspondent way:
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(CryptState.o)' was
built without full bitcode. All object files and libraries for bitcode
must be generated from Xcode Archive or Install build for architecture
arm64
And finally the installation on my iOS 9 iPhone 6S went fine with just the same contents in the warning:
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(CryptState.o)' was
built without full bitcode. All object files and libraries for bitcode
must be generated from Xcode Archive or Install build for architecture
arm64
CryptState.cpp if a c++ file in the library.
Check architectures it has with lipo tool. Open terminal, navigate to folder where your library is and do:
lipo -info yourlib.a
If you don't have x86_64, than you should find/compile lib that will have it.
x86_64 is an architecture for Simulator, not for generic iOS device.
I applied the suggestion at:
Xcode 7 'CrashReporter does not contain bitcode' linker error
by adding option -fembed-bitcode to the other linker flags field. And now the problem has moved to a c file: band.c, notwithstanding of course I have added this option for the c and c++ files.
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(bands.o)' was built
without full bitcode. All object files and libraries for bitcode must
be generated from Xcode Archive or Install build for architecture
arm64
What might be still missing?
I aborted the attempt. There must be something faulty in the original mumble kit project not allowing to import its library into another project, or I do not know how to do it anyway.
I'm just starting iOS development.
I am trying to add frameworks to my app, but then get a linker error:
ld: warning: ld: warning: ignoring file /Users/user/Google
Drive/spring 2015/romo
project/RomoSDK_v1.0C/frameworks/RMCore.framework/RMCore, missing
required architecture x86_64 in file /Users/user/Google Drive/spring
2015/romo project/RomoSDK_v1.0C/frameworks/RMCore.framework/RMCore (3
slices)ignoring file /Users/user/Google Drive/spring 2015/romo
project/RomoSDK_v1.0C/CoreMotion.framework/CoreMotion, missing
required architecture x86_64 in file /Users/user/Google Drive/spring
2015/romo project/RomoSDK_v1.0C/CoreMotion.framework/CoreMotion (3
slices)
Any ideas why I would get this error and how to fix it?
Thank you.
The problem occurs because you have set the project to build for the iOS simulator,which is running on the x86_64 architecture. And the error tells you that this architecture is not supported by the romo framework.
Check what happens when you change to compile for a real device, the error should be gone.
I don't know the romo framework, but my guess would be that it only provides the armv6, armv7 and arm64 architectures for real iOS devices.
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 made my own framework and everything was fine. But when Apple releases 64bit architecture when another project uses 64-bit architecture my framework doesn't want to compile.
When I changed architecture of project just armv7 and armv7s - it complies good but when i changed architecture back to arm64 - it produces error -
(null): "_OBJC_CLASS_$MYFramework", referenced from:
objc-class-ref in RWAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So I've changed architecture of framework to include arm64, but error in my project still there
Is there another way to support arm64?
I added a screenshot of support architectures of framework
From error description you provided I can see that:
During linking phase for Intel 64bit architecture _OBJC_CLASS_$MYFramework symbol was not found. Which is quite strange as you sure you compiling for arm architecture. Maybe you should revise Makefiles of your framework?
Have a look here Shell you make target IOS7 32bit?
I created a static library with Xcode I have compiled selecting a device.
I added this to my library test project in Xcode 4.6
but I always have 2 errors during the linking...
I followed this tutorial: Static Library iOS Tutorial
if I download the sample code I have the same errors:
ld: warning: ignoring file /Users/Downloads/ICodeBlogStaticLibrarySample/MathTest/Classes/iCodeBlogsMathLibrary/libICodeMathUtils.a, missing required architecture i386 in file /Users/Downloads/ICodeBlogStaticLibrarySample/MathTest/Classes/iCodeBlogsMathLibrary/libICodeMathUtils.a (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MathFunctions", referenced from:
objc-class-ref in MathTestAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had once made a static lirary , I had the same problem .
Solution was to "Run the app on device " not on simulator , it works fine then !!!
Hope this helps...
I followed this step by step tutorial:
Tutorial
in particular I had to add these flags: -ObjC and -all_load
You must have selected iOS simulator while building the project. Select iOS device and it should be fine.
Do read and try to understand the error message, it's a meaningful English phrase.
symbol(s) not found for architecture i386
So there's no compiled code for the i386 architecture in the library. This means that either it's compiled for ARM only (for actual iOS devices, like iPhone or iPad), or for the 64-bit simulator (x86_64). Use otool to find out the architectures present in the library.