问题描述
我已经更新了我的X code版本5.0到5.1结果
我在保护的扫描棒code使用ZBarSDK。在模拟器iPhone的Retina(3.5英寸)和iPhone的Retina(4英寸),这是工作的罚款。但是,当我想建立与仿真iPhone的Retina(4英寸64位),这是给下面的错误。
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)
架构:标准体系结构(arm64,ARMv7的,armv7s) - $(ARCHS_STANDARD)结果
有效的体系结构:arm64,ARMv7的,armv7s结果
基本SDK:最新的IOS(IOS 7.1)结果
iOS的部署目标:iOS的6.1
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
任何帮助非常AP preciated!
Any help much appreciated!
推荐答案
使用PODS
pod 'ZBarSDK'
或
重新编译ZBar为iPhone 5。你可以从跳过以下
Recompile ZBar for iphone 5. You can download recompiled ZBAR from here to skip the following
步骤
-
下载源$ C $ C(你必须有适用于Mac ):
打开终端,并以下命令运行
Open Terminal and run following commands
一个。汞克隆
乙。 CD zbar
b. cd zbar
℃。汞检出iPhoneSDK-1.3.1
c. hg checkout iPhoneSDK-1.3.1
Ð。打开iphone / zbar.x codeproj
d. open iphone/zbar.xcodeproj
在在x code项目编辑libzbar计划,并在构建配置选择发布
In the xcode project edit the "libzbar" scheme and select Release in Build configuration
转到构建设置以下架构设置
Go to Build Settings set following Architectures
一个。 架构 - >标准架构(ARMv7的,armv72,arm64)
a. Architectures - >Standard architectures(armv7,armv72,arm64)
乙。 的有效架构 - > arm64,ARMv7的armv7s
b. Valid Architectures -> arm64,armv7 armv7s
有关编译libzbar 设备和模拟,这里的配置:
Compile libzbar for device AND for simulator, here the configuration:
查找编译libzbar.a并使用Teminal.app的文件夹中去,
Find the compiled libzbar.a and go in the folder using Teminal.app,
在我的案例: /Users/kappe/Library/Developer/X$c$c/DerivedData/zbar-gyozyrpbqzvslmfoadhqkwskcesd/Build/Products
In My Case : /Users/kappe/Library/Developer/Xcode/DerivedData/zbar-gyozyrpbqzvslmfoadhqkwskcesd/Build/Products
在此文件夹中应该有两个子文件夹中释放-的iPhoneOS和Release-iphonesimulator
In this folder you you should have two sub folder Release-iphoneos and Release-iphonesimulator
用x code命令行工具构建通用的lib:
using xcode command line tools build your universal lib:
脂-create发布-的iPhoneOS / libzbar.a发布 - iphonesimulator / libzbar.a -o libzbar.a
lipo -create Release-iphoneos/libzbar.a Release-iphonesimulator/libzbar.a -o libzbar.a
现在,您可以使用创建的libzbar.a,无论是在设备和模拟器。
Now you can use the libzbar.a created, both in device and simulator.
参考:
这篇关于X $ C $ 5.1Ç - 适用于建筑x86_64的未定义符号(zbar)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!