In my IOS application external display support is there. So I used libredirect_device.a framework. But I'm getting a warning:
ld: warning: in /Volumes/Decelopment/Subversion/Abbott/trunk/development/Source/Abbott/Abbott/ExternalDisplay/libredirect_device.a, missing required architecture i386 in file
Sounds to me like you'll only get that warning when compiling for simulator. Can you confirm that you're not getting it when compiling for device?
To get rid of the warning I think the library has to be recompiled, so unless you can get a hold of the source or an i386 version you can't get rid of the warning. You could possibly not include it when compiling for simulator.
Related
I've used the gomobile bind tool to build my Go library for use in an iOS app. I've wrapped my library into a Cocoapods .podspec. It works nicely in the simulator (via a local development pod), but when I try to do pod lib lint (part step, part of releasing a cocoapod) I run into errors:
Error:
ld: illegal text-relocation to 'runtime.rodata' in /Users/matti/src/foobar-sdk-ios/Frameworks/Client.framework/Client(go.o) from 'sync/atomic.(*Value).Store' in /Users/matti/src/foobar-sdk-ios/Frameworks/Client.framework/Client(go.o) for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Warning:
- NOTE | [iOS] [FooBarSDK/Go] xcodebuild: ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in sync/atomic.(*Value).Store from /Users/matti/src/foobar-sdk-ios/Frameworks/Client.framework/Client(go.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
It seems to link for other architectures. I couldnt figure out how to skip i386 - even though I override VALID_ARCHS - and I guess it wouldnt be the proper solution anyway.
So instead I'd like to know how to build a proper binary out of my Go code - I tried supplying -ldflags="-extldflags=-pie" to the gomobile bind command but I am assuming its more of a compilation issue. I know there is -buildmode=pie available for go build, but only for main packages and also not for gomobile bind.
Apparently this fixes (suppresses) the error:
spec.pod_target_xcconfig = {
"OTHER_LDFLAGS[arch=i386]" => "-Wl,-read_only_relocs,suppress"
}
I still get the PIE warning but the error is gone and the pod is pushed to the repository ok.
I wonder if Apple will have a beef with a binary missing PIE when pushing to App Store?
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,
I'm using the CocoaLumberjack library in my Xcode project. I'm running into an issue when updating to the latest (2.2.0) version via pod install. Attaching screen of the error I'm seeing. Error description reads:
ld: warning: directory not found for option '-L/$(PROJECT_DIR)/build/Debug-iphoneos'
Undefined symbols for architecture armv7:
"_ddLogLevel", referenced from:
(Various project files referencing 'ddLogLevel')
armv7 is supported as a valid architecture by my CocoaLumberjack target settings.
Tried the solution here https://stackoverflow.com/a/18618187/3347084 but after doing so I received a different compiler error ld: library not found for -lGoogleAnalyticsServices. Could not fix and decided not to go too far down that rabbit hole unless I'm sure it's necessary to fix my original issue.
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've downloaded the newest version of googles admob sdk. But now I keep getting the following error when compiling in xcode 4.5 with the latest sdk.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ASIdentifierManager", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADIdentifierUtilities.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any idea on what could be wrong?
You probably didn't add AdSupport.framework. Also remember to remove -all_load linker flag.
AdSupport.framework need in xcode 4.5 and admob 6.x
On the other way you can fix it without adding extra framework, remove the "-Obj" flag from "Linking > Other Linker Flags" if this flag is not required for your project.
I my case it was different, I had supported the GoogleConvertionTracking.lib but after couple of release customer decided to remove the GoogleConvertionTracking.lib from client. After removing all required code from client I started getting this error of ""_OBJC_CLASS_$_ASIdentifierManager", referenced from:"
After going thru the support doc of GoogleConvertionTracking I found that I had added "-Obj" compiler flag under Under Linking > Other Linker Flags.
* by removing this "-Obj" flag from "Linking > Other Linker Flags" for both rel/deb this error is gone.
I don't have to add AddSupport.framework to get rid of this error.
This change may be helpful for those who don't want to add extra framework to avoid the compilation error.