sebgar
sebgar

Reputation: 196

link in LOCAL_LDLIBS not found

I copied libsonivox.so into /platforms/android-14/arch-arm/usr/lib/, my android.mk file is:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE    := midi
LOCAL_SRC_FILES := midi.c
LOCAL_LDLIBS    += -lsonivox
include $(BUILD_SHARED_LIBRARY)

but when I run ndk-build I get this error:

/home/sebastian/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lsonivox

Any idea what I'm doing wrong? Thanks!

PS: this might look like a dup post, but I read every other post related to this topic, none of them helped

Upvotes: 3

Views: 4328

Answers (2)

Peter M
Peter M

Reputation: 1988

Yes, it appears to have some problem with your path. However, the preferred way to use any pre-built 3rd party library is to use the include $(PREBUILT_SHARED_LIBRARY) method.

As such, I suppose this is probably mostly a duplicate of:

NDK: How to include Prebuilt Shared Library Regardless of Architecture

Another really nice benefit of this method is that if the prebuilt library has any associated headers, you can set it up so that the NDK build system will propagate the include paths for you. It's super nice.

Upvotes: 0

bhavesh kaila
bhavesh kaila

Reputation: 761

please replace local_ldlibs with full path.

LOCAL_LDLIBS     := $(LOCAL_PATH)/jniLibs/lsonivox.so \\path to the lsonivox

Upvotes: 2

Related Questions