[Solved] Android Addons on Linux Eclipse 4.2: Linker Errors

I’m hitting undefined reference (to openCV functions) errors when I add ofxOpenCv to an android project (Eclipse 4.2, x64, Ubuntu). I’m adding ofxOpenCv to addons.make and then including it in the project header. The openCV example works fine though.

Is there a step I’m missing for adding an addon to an android project? Or is this some sort of 32 bit vs 64 bit issue?

Edit 1: here are the errors.

Edit 2: Slowly piecing it together. It seems like the the opencv libs aren’t being linked for some reason…

I just tried it on a 32-bit installation of JRE+eclipse. I’m still hitting the openCV linker error, so that rules out 32 vs 64bit as the source of the problem.

(Some additional info: I’m using ndk-r9b)

In comparing the console output for androidOpenCVExample and my app, I noticed that mine has a different target (e.g. Linking libs/x86/libOFAndroidApp.so for android/x86 instead of android/armeabi-v7a). Then I found that config.make for the androidOpenCVExample had these lines:

ABIS_TO_COMPILE_RELEASE = armv7
ABIS_TO_COMPILE_DEBUG = armv7

If I add that to my app, everything is peachy. So I understand that armv7 is a different architecture than x86, but I’m confused as to why all the examples don’t target armv7. My app is copied from the empty example, so it inherited config.make from there.

Anyone able to fill in the gaps here?

there’s devices that have x86 cpus. by default OF compiles for arm7 and x86 but there’s no compiled opencv for x86 yet so it’ll fail if you don’t specify to compile only for arm7. once we compile the libraries from apothecary (you can also run it in your system) this will be solved

1 Like

And suddenly it all makes sense - thanks @arturo!