Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Building for Android with JPEG, TIFF libraries etc.

Hello all, I am building OpenCV for Android on Ubuntu. I got the code from trunk (2.4.8 on 3/3/2013) and was able to go to platforms and use scripts/cmake_android_arm.sh and then make to build the package.

However, I was unable to use libopencv_highgui in a sample app that I created. My app is C++ native app that I am compiling with ndk-build (not cmake). libopencv_highui doesn't find the image decoder 3rd party libraries like JPEG, TIFF, Jasper etc. I searched and tried a few experiments but can't figure out how to get this working.

So I was able to go into build_android/3rdparty/libjpeg and do a make. I got the liblibjpeg.a and I tried to link this in but didn't work. Any tips appreciated.

Android.mk looks like:

include $(CLEAR_VARS)
LOCAL_MODULE := libopencv_highgui
LOCAL_SRC_FILES := $(OPENCV_LIB_PATH)/libopencv_highgui.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libopencv_core
LOCAL_SRC_FILES := $(OPENCV_LIB_PATH)/libopencv_core.a
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_STATIC_LIBRARIES += libopencv_core libopencv_highgui

Where should I include the libjpeg libtiff or how should I build the OpenCV for Android that these 3rd party are statically linked in to begin with? Thanks!