I have an error with OpenNI2 on Ubuntu 16.04

I’m use Cmake for build a project with Camera Astra 3d. This project include opencv, When I build it with cmake comand I have a problem:

ubuntu@ubuntu-tos:~/src$ make
[ 50%] Building CXX object CMakeFiles/test.dir/main.cpp.o
[100%] Linking CXX executable test
/usr/bin/ld: skipping incompatible /home/ubuntu/Downloads/OpenNI-Linux-Arm-2.3/Redist/libOpenNI2.so when searching for -lOpenNI2
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5/…/…/…/…/lib/libOpenNI2.so when searching for -lOpenNI2
/usr/bin/ld: skipping incompatible /usr/lib/…/lib/libOpenNI2.so when searching for -lOpenNI2
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5/…/…/…/libOpenNI2.so when searching for -lOpenNI2
/usr/bin/ld: skipping incompatible //usr/lib/libOpenNI2.so when searching for -lOpenNI2
/usr/bin/ld: cannot find -lOpenNI2
collect2: error: ld returned 1 exit status
CMakeFiles/test.dir/build.make:140: recipe for target ‘test’ failed
make[2]: *** [test] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/test.dir/all’ failed
make[1]: *** [CMakeFiles/test.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2

How can I fix it ?
Thanks.

Hi,

i encountered the same issue.

May i know how you fixed the issue of “/usr/bin/ld: cannot find -lOpenNI2”?

Thanks in advance!

I have met this issue(quite similar). we just simply copy -lOpenNI2 to /usr/bin/ld but where?

Other solution I think is link to the libraray by command ln…ect…(please check that command).