Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4.6 zXing compile error after Xcode update (4H127)

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?

like image 931
Fulkron Avatar asked Jan 29 '13 22:01

Fulkron


4 Answers

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)

like image 128
txulu Avatar answered Oct 01 '22 20:10

txulu


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

like image 31
krisrak Avatar answered Oct 01 '22 18:10

krisrak


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.

like image 43
Kendall Helmstetter Gelner Avatar answered Oct 01 '22 19:10

Kendall Helmstetter Gelner


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.

like image 41
Ivan Carosati Avatar answered Oct 01 '22 18:10

Ivan Carosati