How to include static library in another ndk project ?

Put problems with the Android NDK in this forum.

How to include static library in another ndk project ?

Postby Muhammad Imran » Tue Oct 25, 2011 12:39 pm

Hi,

I have created static library of one of my project say libABC.a. Now i want to use this static library in another android project at jni layer. The second project would also have its own .cpp files inside jni folder, which would be using the functions of libABC.a static library. Now my question is what are the steps through which i can include static library into another project at jni layer ? Thanks.
Muhammad Imran
Freshman
Freshman
 
Posts: 6
Joined: Mon Sep 26, 2011 10:54 am

Top

Re: How to include static library in another ndk project ?

Postby wodkreso » Tue Nov 01, 2011 7:21 pm

Muhammad,

I'm new to Android, but I had this problem today and found solution. Put this in your Android.mk before your own variables:

include $(CLEAR_VARS)
LOCAL_MODULE := libsharedengine
LOCAL_SRC_FILES := ../../shared/obj/local/$(TARGET_ARCH_ABI)/libsharedengine.a
include $(PREBUILT_STATIC_LIBRARY)


then just before you call BUILD_SHARED_LIBRARY add this line:
LOCAL_STATIC_LIBRARIES := libsharedengine

that shoud do it.

Kreso
wodkreso
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Nov 01, 2011 7:19 pm

Top

Return to NDK Problems

Who is online

Users browsing this forum: No registered users and 2 guests