Hi,
I'm trying to compile an executable to run on a phone. Added a
directory (external/test) and a working Android.mk:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := disptest

LOCAL_SRC_FILES := disptest.cpp

LOCAL_SHARED_LIBRARIES := \
    libutils \
    libui \
    libskia

include $(BUILD_EXECUTABLE)

The binary compiles and works. When I try and add a library
external/test/libtest.a:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
MY_LOCAL_PATH := $(LOCAL_PATH)
LOCAL_PREBUILT_LIBS := libtest.a             
include $(BUILD_MULTI_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := disptest

LOCAL_SRC_FILES := disptest.cpp

LOCAL_SHARED_LIBRARIES := \
    libutils \
    libui \
    libskia

include $(BUILD_EXECUTABLE)

it fails in the linking stage:
make: Entering directory `/home/johann.koenig/android'
target Executable: disptest
(out/target/product/generic/obj/EXECUTABLES/disptest_intermediates/LINKED/disptest)
out/target/product/generic/obj/EXECUTABLES/disptest_intermediates/disptest.o:
In function
`main': /home/johann.koenig/android/external/test/disptest.cpp:89:
undefined reference to
`dec_init_ver' /home/johann.koenig/android/external/test/disptest.cpp:116:
undefined reference to `dec_algo' collect2: ld returned 1 exit
status make: ***
[out/target/product/generic/obj/EXECUTABLES/disptest_intermediates/LINKED/disptest]
Error 1 make: Leaving directory `/home/johann.koenig/android'

These functions exist and can be linked against in other systems,
including the NDK, but not here. For the NDK, the Android.mk was:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := sanangeles

LOCAL_CFLAGS := -DANDROID_NDK \
                -DDISABLE_IMPORTGL

LOCAL_SRC_FILES := \
    basic.c

LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog
apps/san-angeles/project/jni/libtest.a

include $(BUILD_SHARED_LIBRARY)

Any suggestions?
-- 
-Johann Koenig

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to