Skip to content Skip to sidebar Skip to footer

Ndk Error Trying To Build Cyanogenmod Camera Application

A follow up question to an earlier one - compile ICS/JB camera application - native library jni-mosaic error I've been trying to build the ICS camera application from CyanogenMod s

Solution 1:

To understand better how NDK interprets your Android.mk, you can run

ndk-build V=1

This will echo all executed commands, including compilation and link, with all their parameters that NDK build assigns.

Usually, NDK will include the directory C:/android-ndk/platforms/android-14/arch-arm/usr/lib/. If this path for any reason is not specified on the link command line (see V=1 above), you should add it to LOCAL_LDLIBS manually.

LOCAL_LDLIBS += C:/android-ndk/platforms/android-14/arch-arm/usr/lib

The make file in cyanogen tree is not prepared for ndk-build. Instead of using the prebuilt system libraries that are packaged in NDK, it references libraries that it expects to be built during the lunch or brunch. This is why it has the line

LOCAL_SHARED_LIBRARIES := liblog libnativehelper libGLESv2

You don't build the tree; therefore, these libraries are not local. But nevertheless, you must supply all three of them to the linker:

LOCAL_LDLIBS += -llog -lnativehelper -lGLESv2

Unfortunately, only two are delivered with NDK. libnativehelper.so is not part of the public API. This means that in theory, you should not rely on it. In practice, though, this library is present on all devices, and its interface is pretty stable.

You can extract this binary file from your device, or even from an emulator using command

adb pull /system/lib/libnativehelper.so C:/android-ndk/platforms/android-14/arch-arm/usr/lib

Post a Comment for "Ndk Error Trying To Build Cyanogenmod Camera Application"