V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
adow
V2EX  ›  iDev

升级到 Xcode5.1, iOS 7.1 之后,zxing 编译出错了,求帮助

  •  
  •   adow ·
    adow · 2014-03-11 12:06:42 +08:00 · 6154 次点击
    这是一个创建于 3706 天前的主题,其中的信息可能已经有所发展或是发生改变。
    编译时zxing的ChecksumException.h 中

    ````
    #ifndef __CHECKSUM_EXCEPTION_H__
    #define __NOT_FOUND_EXCEPTION_H__
    ````

    '__CHECKSUM_EXCEPTION_H__' is used as a header guard here, followed by #define of a different macro

    我把#define 里改成__CHECKSUM_EXCEPTION_H__ 后又在zxing其他地方有编译错误了。

    在Xcode 5.0.2 中确实没有问题的,我想是不是5.1的编译器参数有不一样了吗?
    8 条回复    1970-01-01 08:00:00 +08:00
    txx
        1
    txx  
       2014-03-11 12:31:23 +08:00   ❤️ 1
    我改了一下...其他地方都是 unused 错误...用 宏 标记一下 就好了 http://stackoverflow.com/questions/18423449/ignore-unused-entity-issue-unused-variable-in-a-single-file

    应该可以修改编译选项 关闭掉...
    sobigfish
        2
    sobigfish  
       2014-03-11 12:41:29 +08:00   ❤️ 1
    zxing 的iOS 分支不是关了么?
    用的port版本?
    txx
        3
    txx  
       2014-03-11 12:46:58 +08:00
    @sobigfish 关了是因为iOS 7 内置了....但是你 5 6 不能不管啊...
    sobigfish
        4
    sobigfish  
       2014-03-11 12:50:05 +08:00
    @txx 其实是可以的:) 现在还用iOS5、6的都不是优质客户群 至少在某些产品定位上
    txx
        5
    txx  
       2014-03-11 12:51:23 +08:00
    @sobigfish 我那天还收到客户投诉呢...一个渠道商的3gs装不了....一问是4.3的系统.......
    jeremyLyu
        6
    jeremyLyu  
       2014-03-20 11:02:28 +08:00   ❤️ 1
    在工程ZXingWidget中的 build settings
    在 Apple LLVM 5.1 - Custom Compiler Flags项目中
    将Other Warning Flags的所有项目给删除掉。
    然后 重新编译就可以了
    bingyingu
        7
    bingyingu  
       2014-04-09 11:49:11 +08:00
    6楼正解哦!
    这样删除不知道,有什么后遗症吗?
    gancl
        8
    gancl  
       2014-04-13 23:36:31 +08:00
    Looks like there are some underground compiler settings changes in XCode 5.1.

    So to fix this issue you need add -w flag to ZXingWidget Other Warning Flags. This flag completely disable all compiler warnings.

    Select ZXingWidget framework.
    Select ZXingWidget target in ZXingWidget framework.
    Press Build setting tab and type "other wa" in search.
    Add -w parameter flag to Other Warning Flags.
    Here is a screen with steps how to add this flag:


    http://stackoverflow.com/questions/22411565/build-error-on-ios-7-1-zxing
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1715 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:02 · PVG 08:02 · LAX 17:02 · JFK 20:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.