0

I meet a problem when I build the libjpeg on android in eclipse. The jni contains Android.mk as follow:

 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := hello-jni LOCAL_SRC_FILES := hello-jni.c #LOCAL_C_INCLUDES := $(LOCAL_PATH)/jpeg8d-master #LOCAL_STATIC_LIBRARIES := libjpeg include $(BUILD_STATIC_LIBRARY) #include $(LOCAL_PATH)/jpeg8d-master/Android.mk 

The jpeg8d is the source code I download from github. The android.mk

LOCAL_PATH:= $(call my-dir) # ------------------------------------------------------------------ # Static library for Cocos # ------------------------------------------------------------------ include $(CLEAR_VARS) LOCAL_MODULE := cocos_jpeg_static LOCAL_MODULE_FILENAME := libjpeg LOCAL_SRC_FILES := \ jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \ jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \ jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \ jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \ jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c \ jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \ jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ jquant2.c jutils.c jmemmgr.c jcarith.c jdarith.c jaricom.c # Use the no backing store memory manager provided by # libjpeg. See install.txt LOCAL_SRC_FILES += \ jmemnobs.c LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) include $(BUILD_STATIC_LIBRARY) 

ndk-build give the tips :

make: Nothing to be done for `all'.

But if I Set the jpeg8d Android.mk BUILD_SHARED_LIBRARY,I get the libjpeg.so. I don't know why. Can anyone help me ?

1 Answer 1

1

Solution: You can redefine the library name by the LOCAL_MODULE_FILENAME. In my problem, I have set the LOCAL_MODULE_FILENAME=libjpeg, but I don't add the APP_MODULES:=cocos_jpeg_static (remember cocos_jpeg_staic is the LOCAL_MODULE not the LOCAL_MODULE_FILENAME) into the Application.mk which is in the jni directory not in the jpeg8d-master directory.

I generate the libjpeg.a when i add this line into the Appliction.mk

APP_MODULES:=cocos_jpeg_static 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.