问题
I replace zBar SDK in my project and faced with the problem.
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Volumes/ZBarSDK/ZBarSDK/libzbar.a file '/Volumes/ZBarSDK/ZBarSDK/libzbar.a' for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I downloaded SDK from http://nerdvision.net/app-development/ios/zbar-sdk
P.S. In simulator it work.
回答1:
You can use a custom version of ZbarSdk built for iOS 7, which can be found here : http://nerdvision.net/app-development/ios/zbar-sdk
回答2:
I didn't have any luck with the NerdVision version, but using this one worked for me immediately.
http://www.federicocappelli.net/2012/10/05/zbar-library-for-iphone-5-armv7s/
回答3:
You can download the library compiled for arm7, arm7s and arm64 here (the nerdvision link is dead)
回答4:
Turn off armv7s in your project architecture settings. It's not really necessary unless you or a library needs the few additional instructions. All it generally does is add "Optimized for iPhone 5" in the app store description.
回答5:
I just upgrade my Xcode 5.1 and iOS 7. When it is compiled onto simulators, it works without problem. When it is compiled onto iPhone 5s running under iOS 7, it is getting an error of linker command. After turn off armv7s, it works fine.
回答6:
I've created a framework using this link and the source code of the ZBarSDK. You can download the framework here. Just unzip the ZBarFramework.framework and drag it in your project. All headers in there are public. To use the framework in code you just have to import the header files.
#import <ZBarFramework/ZBarSDK.h>
// Example Controller
@interface SomeQRViewController : UIViewController <ZBarReaderViewDelegate>
@property (nonatomic, strong) IBOutlet ZBarReaderView *readerView;
@end
来源:https://stackoverflow.com/questions/19361470/zbar-sdk-dont-work-for-armv7sipad-4-ios-7