ZXing Library: Errors in iOS: private field 'cached_y_' is not used

一笑奈何 提交于 2019-12-04 18:55:07

问题


I am currently trying to use the ZXing Library for an iOS Project. However I can't even get the sample Projects to work.

The ScanTest Project, as well as the ones that I created myself throw the following error in the BinaryBitmap.cpp file.

In file included from /Volumes/Macintosh HD/Users/Tim/Downloads/zxing-2.1/iphone/ZXingWidget/../../cpp/core/src/zxing/BinaryBitmap.cpp:20:
../../cpp/core/src/zxing/BinaryBitmap.h:33:7: error: private field 'cached_y_' is not used [-Werror,-Wunused-private-field]
            int cached_y_;
                ^
1 error generated.

I searched on Google and Stackoverflow, but have not found a solution for the problem.

I have tried it with both the current stable release of XCode and the beta.

I don't know if anybody else has got this problem too, but any help would be greatly appreciated.


回答1:


This is clang, right? You can read about the relevant compiler options here. The error message is telling you which compiler flags are relevant.

-Wunused-private-field means you get warnings about private member fields of classes (or structs, ...) that are not used anywhere. The warning is because you probably did mean to use them. This would not normally stop the compilation, but...

-Werror turns warnings into errors. A lot of people use this option to force themselves to write very clean code. Taking this one out should be enough.



来源:https://stackoverflow.com/questions/14447230/zxing-library-errors-in-ios-private-field-cached-y-is-not-used

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!