2

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?
Pado
  • 1,497
  • 16
  • 28
  • I'm not sure about the error you are having when compiling using g++, but I can confirm that the library is 32bit, you should be able to check it with file command. – xuguo Jul 26 '16 at 22:05
  • Did you get it to work? – Matthew Aug 08 '16 at 23:40
  • Sadly not. If you may be interested in a java walk-around you can check: [This answer about rotation using Extrinsics and drift correction](http://stackoverflow.com/questions/38243693/generate-and-export-point-cloud-from-project-tango/38267505) or [This answer about matrix rotation using TangoSupport](http://stackoverflow.com/questions/37949436/project-tango-rotation-and-translation-of-point-clouds-with-area-learning/38087697?noredirect=1#comment63646455_38087697). Also [those comments on Google+](https://plus.google.com/101364445131704310015/posts/R7AHDc3dUip) may be helpful. – Pado Aug 09 '16 at 07:53
  • Thanks, by the time any of us have the 3DR C library kluged into a Java app Google might have it in the Java API SDK. – Matthew Aug 30 '16 at 02:31

0 Answers0