1. In regards to recently combined carrier specific root forums, if your device forum was affected, please see this poll/thread!

NDK - Using static libraries don't find headers


  1. PS: There's another two simpler questions at the end of this post, I want to know those too.

    Hi.. i'm wrapping a native API to Android by NDK.

    But when building it don't find the header files.

    I have the following structure.

    <project>/jni
    Android.mk
    Code (Text):
    1.  
    2. LOCAL_PATH := $(call my-dir)
    3.  
    4. include $(call all-subdir-makefiles)
    5.  
    6. LOCAL_PATH :=/home/marcos/dev/workspace/rmsdk.native.wraper/jni
    7.  
    8. include $(CLEAR_VARS)
    9.  
    10. LOCAL_LDLIBS := -llog
    11.  
    12. LOCAL_MODULE    := ndk1
    13. LOCAL_SRC_FILES := native.c DelegateDRMProcessorClient.cpp
    14. LOCAL_STATIC_LIBRARY := adept cryptopenssl dp expat fonts hobbes jpeg mschema png t3 xml zlib
    15.  
    16. include $(BUILD_SHARED_LIBRARY)
    17.  
    <project>/jni/prereqs/
    Android.mk (Used to call all subdirs Android.mk files)
    Code (Text):
    1.  
    2. LOCAL_PATH := $(call my-dir)
    3. include $(call all-subdir-makefiles)
    4. include $(CLEAR_VARS)
    5.  
    <project>/jni/prereqs/<lib>/
    Android.mk
    Code (Text):
    1.  
    2. LOCAL_PATH := $(call my-dir)
    3.  
    4. include $(CLEAR_VARS)
    5.  
    6. LOCAL_MODULE    :=dp
    7. LOCAL_SRC_FILES :=libdp.a
    8. LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
    9.  
    10. include $(PREBUILT_STATIC_LIBRARY)
    11.  
    And there's a include folder on each <lib> folder.


    Why when compiling I still get a
    "/home/marcos/dev/workspace/rmsdk.native.wraper/jni/DelegateDRMProcessorClient.h:18:20: error: dp_all.h: No such file or directory"

    Another simple questions that I need to know too.

    1

    Advertisement
  2. I have another problem now.

    I get it works copying the include folders to jni/include-all and change my Android.mk to the following
    (And the 1
  3. Another issue.. I wrote a Application.mk and add a APP_MODULES to list my modules, and forgot the main module witch has this problem.

    My surprise running is get the following result:

    Code (Text):
    1.  
    2. marcos@marcos-AY675AA-AC4-s5320br:~/dev/workspace/rmsdk.native.wraper$ ndk-build
    3. Prebuilt       : libadept.a <= jni/prereqs/adept/
    4. Prebuilt       : libcryptopenssl.a <= jni/prereqs/cryptopenssl/
    5. Prebuilt       : libcurl.a <= jni/prereqs/curl/
    6. Prebuilt       : libdp.a <= jni/prereqs/dp/
    7. Prebuilt       : libexpat.a <= jni/prereqs/expat/
    8. Prebuilt       : libfonts.a <= jni/prereqs/fonts/
    9. Prebuilt       : libhobbes.a <= jni/prereqs/hobbes/
    10. Prebuilt       : libjpeg.a <= jni/prereqs/jpeg/
    11. Prebuilt       : libmschema.a <= jni/prereqs/mschema/
    12. Prebuilt       : libpng.a <= jni/prereqs/png/
    13. Prebuilt       : libt3.a <= jni/prereqs/t3/
    14. Prebuilt       : libxml.a <= jni/prereqs/xml/
    15. Prebuilt       : libzlib.a <= jni/prereqs/zlib/
    16.  
    And it never happened before, I think this should execute every time before building the main module, but it looks like it wont.

    Anyone know if there's a way to order my modules build?
  4. Okay, this is LOCAL_STATIC_LIBRARIES, not LOCAL_STATIC_LIBRARY, this works now.
    lullabee likes this.
  5. lullabee

    lullabee New Member

    Thank you for your thread,
    You solved all my problems one by one !

Share This Page