I'm trying to use Tango3DR library (that is written in C) in my java code.
I want to have the android life cycle written in java and use this library just for the computation passing object through jni.
I have moderate knowledge in jni syntax and usage, so that's not a problem. What I cant absolutely do is to import the libtango_3d_reconstruction.so
file i've downloaded from here.
The environment is well configured I think , because
static {
System.loadLibrary("tango_3d_reconstruction");
}
works, and gives no errors or warnings.
But if I try to use this library from c++ code it fails to load the .so file.
I also tried to use this .so in a simple Hello World in c++ using g++ as a compiler, the library is in the correct folder (/usr/lib
) and I think I used the correct flags for g++ (g++ main.cpp -o main -ltango_3d_reconstruction
).
This doesn't work and dynamic linker gives me this warning and errors (very similar to the ones in android studio):
/usr/bin/ld: skipping incompatible //usr/lib/libtango_3d_reconstruction.so when searching for -ltango_3d_reconstruction
/usr/bin/ld: cannot find -ltango_3d_reconstruction
I read on the net that this "skipping incompatible libfoo.so when searching for -lfoo" happens when there is a mismatch between 32 and 64bit system. I have a 64bit system, so I tried with the -m32
flag and I got the same error.
I also tried with the -m64
flag but (as obvious) I got the same again.
Last try: i switched back to my Android Studio, I downloaded the windows 32bit version of NDK and tried out with this; nothing, still skipping.
- Any idea?
- Is
libtango_3d_reconstruction.so
really 32b?