OpenNI / OpenNI2

OpenNI2
Apache License 2.0
432 stars 892 forks source link

Compiling OpenNI2-2.0.0.30 on mac fails: struct Version in OpenNI.h clashes with Version() in PS1080Console.cpp #41

Open dankegel opened 11 years ago

dankegel commented 11 years ago

With the g++ that comes with XCode, i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) compiling 5b88c95e4f8d19b95713e3c873c7d07e48e5605b fails for me as follows:

g++ -x c++ -c  -arch i386 -arch x86_64 -msse3 -arch i386 -arch x86_64 -msse3 -Wall -O2 -DNDEBUG -I../../../../Include -I../../../../ThirdParty/PSCommon/XnLib/Include -I../Include -I/opt/local/include  -fPIC -fvisibility=hidden -o ../../../../Bin/Intermediate/x64-Release/PS1080Console/PS1080Console.o PS1080Console.cpp
../../../../Include/OpenNI.h: In function ‘int main(int, char**)’:
../../../../Include/OpenNI.h:55: error: ‘openni::Version’ is not a function,
PS1080Console.cpp:140: error:   conflict with ‘bool Version(openni::Device&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)’
PS1080Console.cpp:1676: error:   in call to ‘Version’
../../../../Include/OpenNI.h: At global scope:
../../../../Include/OpenNI.h:90: warning: ‘openni::ANY_DEVICE’ defined but not used

I work around this with a patch https://gist.github.com/dankegel/6709167 that renames the function to be PrintVersion().