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

2014-03-11 12:06:42 +08:00
 adow
编译时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的编译器参数有不一样了吗?
6188 次点击
所在节点    iDev
8 条回复
txx
2014-03-11 12:31:23 +08:00
我改了一下...其他地方都是 unused 错误...用 宏 标记一下 就好了 http://stackoverflow.com/questions/18423449/ignore-unused-entity-issue-unused-variable-in-a-single-file

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

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/103782

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX