FAQ
I am using this command to generate two .so files for two different .c
files, however the one on top is generated and the below one is not.

My classes class-a and class-b are in the same folder named jni under
project directory.

Here is my mk file.

MY_LOCAL_PATH := $(call my-dir)
include $(all-subdir-makefiles)

LOCAL_PATH :=$(MY_LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE := class-a
LOCAL_SRC_FILES := class-a.c
LOCAL_C_INCLUDES := $(MY_LOCAL_PATH) $(MY_LOCAL_PATH)/somefolder
LOCAL_SHARED_LIBRARIES := somelibrary
LOCAL_LDLIBS += -lz -llog
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := class-b
LOCAL_SRC_FILES := class-b.c
LOCAL_C_INCLUDES := $(MY_LOCAL_PATH) $(MY_LOCAL_PATH)/somefolder
LOCAL_SHARED_LIBRARIES := somelibrary
LOCAL_LDLIBS += -lz -llog
include $(BUILD_SHARED_LIBRARY)

How can I make a seperate .so file for my class-b?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/3gtpr7158n0J.
To post to this group, send email to android-ndk@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Search Discussions

  • David Turner at Aug 31, 2012 at 1:11 pm
    This is weird. A few recommendations:

    - Call all-subdir-makefiles at the end of your Android.mk, not at the start
    (though normally you're saving/restoring LOCAL_PATH properly, so this
    should work).

    - You can print the module database from ndk-build with:

    ndk-build NDK_LOG=1 NDK_DEBUG_MODULES=1 <other-options>

    This should tell you exactly what modules were defined / recorded, and what
    their dependencies are.
    Please attach the output to your reply so we can have a look at it.

    On Fri, Aug 31, 2012 at 9:20 AM, Arif Nadeem wrote:

    I am using this command to generate two .so files for two different .c
    files, however the one on top is generated and the below one is not.

    My classes class-a and class-b are in the same folder named jni under
    project directory.

    Here is my mk file.

    MY_LOCAL_PATH := $(call my-dir)
    include $(all-subdir-makefiles)

    LOCAL_PATH :=$(MY_LOCAL_PATH)
    include $(CLEAR_VARS)
    LOCAL_MODULE := class-a
    LOCAL_SRC_FILES := class-a.c
    LOCAL_C_INCLUDES := $(MY_LOCAL_PATH) $(MY_LOCAL_PATH)/somefolder
    LOCAL_SHARED_LIBRARIES := somelibrary
    LOCAL_LDLIBS += -lz -llog
    include $(BUILD_SHARED_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_MODULE := class-b
    LOCAL_SRC_FILES := class-b.c
    LOCAL_C_INCLUDES := $(MY_LOCAL_PATH) $(MY_LOCAL_PATH)/somefolder
    LOCAL_SHARED_LIBRARIES := somelibrary
    LOCAL_LDLIBS += -lz -llog
    include $(BUILD_SHARED_LIBRARY)

    How can I make a seperate .so file for my class-b?

    --
    You received this message because you are subscribed to the Google Groups
    "android-ndk" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/android-ndk/-/3gtpr7158n0J.
    To post to this group, send email to android-ndk@googlegroups.com.
    To unsubscribe from this group, send email to
    android-ndk+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/android-ndk?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "android-ndk" group.
    To post to this group, send email to android-ndk@googlegroups.com.
    To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
  • Arif Nadeem at Sep 3, 2012 at 11:40 pm
    Thanks Digit, I solved it by making an Application.mk file and
    including APP_MODULES as APP_MODULES := class-a.c class-b.c

    *NOTE: In APP_MODULES all module names must be separated by a space.*
    On Friday, August 31, 2012 6:34:52 PM UTC+5:30, Digit wrote:

    This is weird. A few recommendations:

    - Call all-subdir-makefiles at the end of your Android.mk, not at the
    start (though normally you're saving/restoring LOCAL_PATH properly, so this
    should work).

    - You can print the module database from ndk-build with:

    ndk-build NDK_LOG=1 NDK_DEBUG_MODULES=1 <other-options>

    This should tell you exactly what modules were defined / recorded, and
    what their dependencies are.
    Please attach the output to your reply so we can have a look at it.


    On Fri, Aug 31, 2012 at 9:20 AM, Arif Nadeem <arifn...@gmail.com<javascript:>
    wrote:
    I am using this command to generate two .so files for two different .c
    files, however the one on top is generated and the below one is not.

    My classes class-a and class-b are in the same folder named jni under
    project directory.

    Here is my mk file.

    MY_LOCAL_PATH := $(call my-dir)
    include $(all-subdir-makefiles)

    LOCAL_PATH :=$(MY_LOCAL_PATH)
    include $(CLEAR_VARS)
    LOCAL_MODULE := class-a
    LOCAL_SRC_FILES := class-a.c
    LOCAL_C_INCLUDES := $(MY_LOCAL_PATH) $(MY_LOCAL_PATH)/somefolder
    LOCAL_SHARED_LIBRARIES := somelibrary
    LOCAL_LDLIBS += -lz -llog
    include $(BUILD_SHARED_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_MODULE := class-b
    LOCAL_SRC_FILES := class-b.c
    LOCAL_C_INCLUDES := $(MY_LOCAL_PATH) $(MY_LOCAL_PATH)/somefolder
    LOCAL_SHARED_LIBRARIES := somelibrary
    LOCAL_LDLIBS += -lz -llog
    include $(BUILD_SHARED_LIBRARY)

    How can I make a seperate .so file for my class-b?

    --
    You received this message because you are subscribed to the Google Groups
    "android-ndk" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/android-ndk/-/3gtpr7158n0J.
    To post to this group, send email to andro...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    android-ndk...@googlegroups.com <javascript:>.
    For more options, visit this group at
    http://groups.google.com/group/android-ndk?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "android-ndk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/zhfDfx4dPQUJ.
    To post to this group, send email to android-ndk@googlegroups.com.
    To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupandroid-ndk @
categoriesandroid
postedAug 31, '12 at 11:19a
activeSep 3, '12 at 11:40p
posts3
users2
websitedeveloper.android.com...

2 users in discussion

Arif Nadeem: 2 posts David Turner: 1 post

People

Translate

site design / logo © 2017 Grokbase