android jni problem with prebuilt shared library

by ashish vijay » Thu, 19 May 2011 02:49:57 GMT


Sponsored Links
 i am new to android. i m developing a android jni application.
i m trying to build shared library(libnkd_1.so)by "ndk-build".
 which is using functions from prebuilt shared library (libndk_2.so).
i dont have source code for libndk_2.so. this libndk_2.so is linux gcc
generated.

my android.mk is

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE    := ndk_2
NDK_MODULE_PATH := $(LOCAL_PATH)
LOCAL_SRC_FILES := libndk_2.so
include $(PREBUILT_SHARED_LIBRARY)


include $(CLEAR_VARS)
LOCAL_MODULE :=ndk_1
LOCAL_SRC_FILE:=ndk_1.c
LOCAL_SHARED_LIBRARY := ndk_2
include $(BUILD_SHARED_LIBRARY)

when i try to use ndk-build for building shared library it shows the
following error.


#ndk-build
 Install        : libndk_1.so => libs/armeabi/libndk_1.so
 Install        : libndk_2.so => libs/armeabi/libndk_2.so
 /home/ashish/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/
prebuilt/linux-x86/bin/arm-linux-androideabi-           strip:
Unable to recognise the format of the input file `/root/workspace/ndk1/
libs/armeabi/libndk_2.so'
       make: *** [/root/workspace/ndk1/libs/armeabi/libndk_2.so] Error
1

please help me out.
thanks in advance

-- 



Re: android jni problem with prebuilt shared library

by Nikolay Elenkov » Thu, 19 May 2011 09:37:10 GMT


 On Wed, May 18, 2011 at 3:10 PM, ashish vijay



Not the right forum for NDK questions, but in short: you can't link
 to a library built for another platform. You need to build it (or have
it built if you don't have the source) with the NDK.

-- 


Sponsored Links


Other Threads

1. How do I draw onto an app using an XML layout?

How do I draw shapes in an app that uses an XML layout? All of the 
examples that I've found only draw the shapes without using XML!
On the android site 
here,http://developer.android.com/guide/topics/graphics/index.html

it says:

If you'll be drawing some simple graphics (images, shapes, colors, pre-defined animations, etc.), then you should probably just draw to the background of a View or to the content of an ImageView in your layout.
How do I do that? Is there some example code somewhere on how to do this? Something like the Hello Android with the code to draw a circle on an ImageView? HELP! Thanks. --

2. Pejing Cak Nurfat

Cak Boss,

Kalo monitor dimari, tlg konfirmasi yang di email yak

Suwun

-- 
"Indonesian Android Community [id-android]" 

3. Froyo: android.app.backup.* : works on Emulator?

4. the problem about activty re-launched

5. Adding a 'Flattr'-Button in an app

6. samsung app store

7. R: Searching for Vumeter or needle indicator