Hello,
I'm trying to compile a JNI project using libjpeg-turbo.
I successfully build the library thanks to this link
http://stackoverflow.com/questions/12260149/libjpeg-turbo-for-android
But my project can not compile on eclipse:
/home/fabien/android/android-ndk-r8b/ndk-build all
Compile++ thumb : effectsjni <= effectsjni.cpp
In file included from
jni/com_fabien_r_testyourwebcam_opengl2_jni_OpenGL2JniInterface.h:2:0,
from jni/effectsjni.cpp:6:
/home/fabien/android/android-ndk-r8b/platforms/android-14/arch-arm/usr/include/jni.h:592:13:
note: the mangling of 'va_list' has changed in GCC 4.4
Compile++ thumb : effectsjni <= glutil.cpp
Compile++ thumb : effectsjni <= Image.cpp
Prebuilt : libstlport_static.a <=
<NDK>/sources/cxx-stl/stlport/libs/armeabi/
Prebuilt : libjpeg.so <= jni/
SharedLibrary : libeffectsjni.so
./obj/local/armeabi/objs/effectsjni/gltools/Image.o: In function
`Image::savePicture()':
/home/fabien/workspace/TestYourWebcam/jni/gltools/Image.cpp:291:
undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
/home/fabien/workspace/TestYourWebcam/jni/gltools/Image.cpp:292:
undefined reference to `jpeg_CreateCompress(jpeg_compress_struct*, int,
unsigned int)'
/home/fabien/workspace/TestYourWebcam/jni/gltools/Image.cpp:293:
undefined reference to `jpeg_stdio_dest(jpeg_compress_struct*, __sFILE*)'
/home/fabien/workspace/TestYourWebcam/jni/gltools/Image.cpp:294:
undefined reference to `jpeg_set_defaults(jpeg_compress_struct*)'
/home/fabien/workspace/TestYourWebcam/jni/gltools/Image.cpp:301:
undefined reference to `jpeg_set_quality(jpeg_compress_struct*, int, int)'
/home/fabien/workspace/TestYourWebcam/jni/gltools/Image.cpp:302:
undefined reference to `jpeg_start_compress(jpeg_compress_struct*, int)'
/home/fabien/workspace/TestYourWebcam/jni/gltools/Image.cpp:310:
undefined reference to `jpeg_write_scanlines(jpeg_compress_struct*,
unsigned char**, unsigned int)'
/home/fabien/workspace/TestYourWebcam/jni/gltools/Image.cpp:313:
undefined reference to `jpeg_finish_compress(jpeg_compress_struct*)'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libeffectsjni.so] Error 1
**** Build Finished ****
I tried to link the static and the shared library using this Android.mk
file without success:
LOCAL_PATH := $(call my-dir)
# JPEG support
include $(CLEAR_VARS)
LOCAL_MODULE := jpeg
#LOCAL_SRC_FILES := libjpeg.a
LOCAL_SRC_FILES := libjpeg.so
LOCAL_EXPORT_C_INCLUDES :=
/home/fabien/android/android-sdk-linux/sources/external/libjpeg-turbo
#include $(PREBUILT_STATIC_LIBRARY)
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := effectsjni
### Add all source file names to be included in lib separated by a
whitespace
LOCAL_SRC_FILES := effectsjni.cpp gltools/glutil.cpp gltools/Image.cpp
#LOCAL_CFLAGS := -Werror
LOCAL_LDLIBS := -llog -lGLESv2
# Missing includes
LOCAL_C_INCLUDES += /home/fabien/android/spica/sources/glm
# Link to JPEG
#LOCAL_STATIC_LIBRARIES := jpeg
LOCAL_SHARED_LIBRARIES := jpeg
include $(BUILD_SHARED_LIBRARY)
Any hints ?
-
Fabien