OpenNI2 icon indicating copy to clipboard operation
OpenNI2 copied to clipboard

Fixes for compiling under OSX 10.8 with clang

Open ChristianFrisson opened this issue 12 years ago • 3 comments

Hi,

Some private fields in OpenNI2 classes are colliding with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) that uses -Werror,-Wunused-private-field. So as to make OpenNI2 compile, it did 2 kinds of hacks:

  • promoting from private to protected
  • commenting out the unused private class members.

I don't know about the OpenNI2 architecture, hence the hacks. Could you please review these?

Best regards, Christian

ChristianFrisson avatar Aug 24 '13 12:08 ChristianFrisson

IMHO, disallowing ANY unused private field is too strict and counter-productive especially when the code is in the beta status. As you rightly say it is a "hack", promoting private to protected just because the compiler complains does not make sense. I think the reasonable solution is "not" to treat unused private field as an error. Perhaps -Wno-error=unused-private-field would work?

tomoto avatar Aug 27 '13 16:08 tomoto

Hi, I am a Software developer in Beijing,I have a question need your help. I want to setting videostream through videomode, but it didn't work. Then i call the openni's getExtendedError function,it return "Stream setProperty(3) failed ", I want to know what's wrong with it,can you help me?

ing4shubowei

yingshixiaohu avatar Sep 05 '13 07:09 yingshixiaohu

You can work around this with

make ALLOW_WARNINGS=1

dankegel avatar Sep 26 '13 02:09 dankegel