Xcode 4.6 zXing compile error after Xcode update (4H127)
Asked Answered
M

4

16

Different projects using ZXing have error after last Xcode update:

Error messages are:

  1. private field 'cached_y_' is not used
  2. Private field 'bits_' is not used
  3. Private field 'cached_row_num_' is not used
  4. Private field 'dataHeight_' is not used

Any compiler flag I have to set up?

Mcgough answered 29/1, 2013 at 22:33 Comment(6)
I don't think these are errors, rather warnings.Dispose
i assume these are not errors but warnings for the fields which you might have not used within your projectAnile
Unfortunately the compiler show them as errors (red color and not yellow color as for warning) and is impossible to complete the build phase. I try to remove the "unused" variable definitions but the error appears somewhere else (variable not defined...)Mcgough
This should be posted to the ZXing project page, not SO. It's always best to contact the developers directly for such an issue.Prepositive
Did you ever get a fix for this? Got the same issue...Braeunig
This modifications work (tested): code.google.com/p/zxing/source/detail?r=2566#Alten
M
40

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.

How to set compiler flags

(No need to remove any other flag, just ignore unused private field warning)

Monosyllable answered 5/2, 2013 at 9:14 Comment(4)
The best temporary fix up to this time. ThanksMcgough
if i were @Mcgough i would have accepted this answer. This is the most straight forward answer to this problem :)Harragan
This solution leaves the project clean without warningsMonosyllable
@Monosyllable After fixing this i got issue from SMSAction.h file?Tepee
B
13

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

enter image description here

Broadspectrum answered 31/1, 2013 at 0:22 Comment(1)
Its in the section titled "Apple LLVM 4.2 compiler warning flags". See screenshot here: dropbox.com/s/az64llbjqv326mr/llvm_compiler_warning_flags.pngOnym
F
3

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.

Fey answered 29/1, 2013 at 23:24 Comment(2)
Are you looking at the target it's trying to compile?Fey
OK in the subProject target there is the flag to change to avoid error messages. Hope they fix asap. tnxMcgough
F
2

Looks like this is a temporary fix http://code.google.com/p/zxing/issues/detail?id=1494 I hope for a much nicer solution soon.

Forego answered 30/1, 2013 at 6:35 Comment(1)
Just removing the "Other Warning Flags" "-Werror" worked perfectly for me! Got only 4 warnings so far. (Which is just what Kendall Helmstetter Gelner was saying)Forego

© 2022 - 2024 — McMap. All rights reserved.