Xcode 更新后 Xcode 4.6 zXing 编译错误 (4H127)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14593291/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 4.6 zXing compile error after Xcode update (4H127)
提问by Fulkron
Different projects using ZXing have error after last Xcode update:
使用 ZXing 的不同项目在上次 Xcode 更新后出现错误:
Error messages are:
错误信息是:
- private field 'cached_y_' is not used
- Private field 'bits_' is not used
- Private field 'cached_row_num_' is not used
- Private field 'dataHeight_' is not used
- 未使用私有字段 'cached_y_'
- 未使用私有字段“bits_”
- 未使用私有字段 'cached_row_num_'
- 未使用私有字段“dataHeight_”
Any compiler flag I have to set up?
我必须设置任何编译器标志?
回答by txulu
Just add this flag
只需添加此标志
-Wno-unused-private-field
under ZXingWidget target -> Build Settings -> Other Warning Flags. Click the + button and paste the flag, clean and build again.
在 ZXingWidget 目标 -> 构建设置 -> 其他警告标志下。单击 + 按钮并粘贴标志,清理并再次构建。
(No need to remove any other flag, just ignore unused private field warning)
(无需删除任何其他标志,只需忽略未使用的私有字段警告)
回答by krisrak
Here is a workaround to get it to compile. You have remove couple compile warning flags:
这是使其编译的解决方法。您已经删除了几个编译警告标志:
Select the xzing project, build settings, look for "Other Warning Flags" and remove -Werror and -Wno-unused-parameter
选择 xzing 项目,构建设置,查找“其他警告标志”并删除 -Werror 和 -Wno-unused-parameter
回答by Kendall Helmstetter Gelner
They have the project set up to treat warnings as errors. Turn off that setting and it should compile, so you can at least run the sample code.
他们将项目设置为将警告视为错误。关闭该设置,它应该可以编译,因此您至少可以运行示例代码。
Also tell them so they can fix the warnings.
同时告诉他们,以便他们可以修复警告。
回答by Ivan Carosati
Looks like this is a temporary fix http://code.google.com/p/zxing/issues/detail?id=1494I hope for a much nicer solution soon.
看起来这是一个临时修复http://code.google.com/p/zxing/issues/detail?id=1494我希望很快有更好的解决方案。