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?

pap
  • 27,064
  • 6
  • 41
  • 46
Fulkron
  • 1,013
  • 2
  • 14
  • 22
  • 1
    I don't think these are errors, rather warnings. –  Jan 29 '13 at 22:35
  • i assume these are not errors but warnings for the fields which you might have not used within your project – nsgulliver Jan 29 '13 at 22:35
  • 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...) – Fulkron Jan 29 '13 at 22:40
  • 2
    This should be posted to the ZXing project page, not SO. It's always best to contact the developers directly for such an issue. – rmaddy Jan 29 '13 at 22:49
  • 1
    Did you ever get a fix for this? Got the same issue... – thunderousNinja Jan 30 '13 at 02:43
  • This modifications work (tested): http://code.google.com/p/zxing/source/detail?r=2566# – Rok Jarc Mar 11 '13 at 17:02

4 Answers4

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)

txulu
  • 1,602
  • 16
  • 26
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

krisrak
  • 12,882
  • 3
  • 32
  • 46
  • Its in the section titled "Apple LLVM 4.2 compiler warning flags". See screenshot here: https://www.dropbox.com/s/az64llbjqv326mr/llvm_compiler_warning_flags.png – Shiprack Feb 03 '13 at 14:06
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.

Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150
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.

Ivan Carosati
  • 355
  • 4
  • 13
  • 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) – Ivan Carosati Jan 30 '13 at 15:56