xcode 5.1 – Undefined symbols for architecture x86_64 (zbar)
I have updated my x code version from 5.0 to 5.1
I have used ZBarSDK in my protect for scan bar code. In simulator ‘iPhone Retina (3.5-inch)’ and ‘iPhone Retina(4-inch)’, it is working fine. But when i want to build with simulator ‘iPhone Retina (4-inch 64-bit)’, it is giving the following error.
ld: warning: ignoring file /Users/sayan/Desktop/ProjectAtanu/Omlis/Custom Classes/ZBarSDK/libzbar.a, missing required architecture x86_64 in file /Users/sayan/Desktop/ProjectAtanu/Omlis/Custom Classes/ZBarSDK/libzbar.a (3 slices) Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_ZBarReaderViewController", referenced from: objc-class-ref in HomeViewController.o "_ZBarReaderControllerResults", referenced from: -[HomeViewController imagePickerController:didFinishPickingMediaWithInfo:] in HomeViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Architecture: Standard architecture(arm64, armv7, armv7s) – $(ARCHS_STANDARD)
Valid Architectures: arm64,armv7,armv7s
Base SDK: Latest IOS(IOS 7.1)
iOS Deployment Target: iOS 6.1
Any help much appreciated!
- How to add armv6 architecture to Xcode project?
- Core Data on client (iOS) to cache data from a server Strategy
- duplicate symbols for architecture arm64 after xCode 8.0 update
- Clean Architecture - Robert Martin - How to connect use cases
- iOS app submission : missing 64-bit support
- What Design Patterns are used on iOS other than MVC?
3 Solutions Collect From Internet About “xcode 5.1 – Undefined symbols for architecture x86_64 (zbar)”
Recompile ZBar for iphone 5. You can download recompiled ZBAR from here to skip the following
Download the source code (you must have Mercurial for mac):
Open Terminal and run following commands
b. cd zbar
c. hg checkout iPhoneSDK-1.3.1
d. open iphone/zbar.xcodeproj
In the xcode project edit the “libzbar” scheme and select Release in Build configuration
Go to Build Settings set following Architectures
a. Architectures – >Standard architectures(armv7,armv72,arm64)
b. Valid Architectures -> arm64,armv7 armv7s
Compile libzbar for device AND for simulator, here the configuration:
Find the compiled libzbar.a and go in the folder using Teminal.app,
In My Case : /Users/kappe/Library/Developer/Xcode/DerivedData/zbar-gyozyrpbqzvslmfoadhqkwskcesd/Build/Products
In this folder you you should have two sub folder Release-iphoneos and Release-iphonesimulator
using xcode command line tools build your universal lib:
lipo -create Release-iphoneos/libzbar.a Release-iphonesimulator/libzbar.a -o libzbar.a
Now you can use the libzbar.a created, both in device and simulator.
This implies the library is not supported/built for the new archtitecture.
For zBar this answer has link to tutorial where you can download the source and just update the lib to new architecture.
Generally for a third party service. they will release new lib with the architecture added so make sure to check out their site for updated SDK.
Put in you Build Settings under “Other Librarian Flags” and “Other Linker Flags”: $(OTHER_LDFLAGS)
- IOS7 UIPickerView how to hide the selection indicator
- iOS 7.1 UitableviewCell content overlaps with ones below
- Can I make Firebase use a username login process?
- Where did the Homekit Accessory Simulator go in Xcode 6 beta 6?
- NSData from Byte array in Swift
- How to create IPA in Xcode 6?
- get SecKeyRef from base64 coded string
- swift – KVO – change.newValue and change.oldValue are nil
- Simplest way to implement a “Read More” button to expand a UITextView in iOS Swift 2?
- NSArray of united Arrays
- How to get UIView given a CGPoint?
- Xcode- Importing Objective C files into a C file
- Swift – Reorder UITableView cells
- Receive Custom Notification iOS swift 2.0
- How to get a NSDATE from UIImage?