xcode 5.1 - 架构x86_64(zbar)的未定义符号

Ata*_*dal 12 architecture xcode objective-c ios

我已经将我的x代码版本从5.0更新到5.1
我在我的项目中使用了ZBarSDK来扫描条形码.在模拟器'iPhone Retina(3.5英寸)'和'iPhone Retina(4英寸)',它工作正常.但是当我想用模拟器'iPhone Retina(4英寸64位)'构建时,它会出现以下错误.

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)
Run Code Online (Sandbox Code Playgroud)

架构:标准架构(arm64,armv7,armv7s) - $(ARCHS_STANDARD)
有效架构:arm64,armv7,armv7s
基础SDK:最新IOS(IOS 7.1)
iOS部署目标:iOS 6.1

任何帮助非常感谢!

Kir*_*ela 30

使用PODS

pod 'ZBarSDK'
Run Code Online (Sandbox Code Playgroud)

要么

重新编译ZBar for iphone 5.您可以从此处下载重新编译的ZBAR 以跳过以下内容

脚步

  1. 下载源代码(您必须拥有Mercurial for mac):

  2. 打开终端并运行以下命令

    一个.hg clone http://zbar.hg.sourceforge.net:8000/hgroot/zbar/zbar

    湾 cd zbar

    C.hg checkout iPhoneSDK-1.3.1

    d.打开iphone/zbar.xcodeproj

  3. 在xcode项目中编辑"libzbar"方案并选择Build in Build配置

  4. 转到遵循体系结构的构建设置集

    一个.架构 - >标准架构(armv7,armv72,arm64)

    有效的架构 - > arm64,armv7 armv7s

  5. 设备模拟器编译libzbar ,这里配置:

  6. 找到已编译的libzbar.a并使用Teminal.app进入该文件夹,

    在我的案例中:/ Users/kappe/Library/Developer/Xcode/DerivedData/zbar-gyozyrpbqzvslmfoadhqkwskcesd/Build/Products

    在此文件夹中,您应该有两个子文件夹Release-iphoneos和Release-iphonesimulator

  7. 使用xcode命令行工具构建您的通用库:

    lipo -create发布-iphoneos/libzbar.a发布-iphonesimulator/libzbar.a -o libzbar.a

    现在您可以在设备和模拟器中使用创建的libzbar.a.

参考:http://www.federicocappelli.net/2012/10/05/zbar-library-for-iphone-5-armv7s/

  • 结果:https://drive.google.com/file/d/0B-p7lFlJim9YUFh6a3ZJWlNwQUU/view?usp=sharing (5认同)

Shu*_*ank 2

这意味着该库不受新架构的支持/构建。

对于 zBar,这个答案有教程的链接,您可以在其中下载源代码并将库更新到新的架构。

一般用于第三方服务。他们将发布添加了架构的新库,因此请务必查看他们的网站以获取更新的 SDK。