Question

I have the dsplink application running on android omapl138 board.I can run the application in the terminal. I have included the dsplink application in ndk and tried to compile using following Android.mk

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_LDLIBS += $(LOCAL_PATH)/dsplink.a

LOCAL_C_INCLUDES += C:\dsplink_1_65_01_05_eng\dsplink\gpp\export\INCLUDE\Linux\OMAPL138\sys
LOCAL_C_INCLUDES += C:\dsplink_1_65_01_05_eng\dsplink\gpp\export\INCLUDE\Linux\OMAPL138\usr
LOCAL_C_INCLUDES += C:\dsplink_1_65_01_05_eng\dsplink\gpp\inc\sys\linux
LOCAL_C_INCLUDES += C:\dsplink_1_65_01_05_eng\dsplink\gpp\src\api
LOCAL_C_INCLUDES += C:\dsplink_1_65_01_05_eng\dsplink\gpp\export\INCLUDE\Linux\OMAPL138\internal
LOCAL_C_INCLUDES += C:\dsplink_1_65_01_05_eng\dsplink\gpp\export\INCLUDE\Linux\OMAPL138\sys\arch

LOCAL_MODULE    := libdsp-message
LOCAL_SRC_FILES := message.c message_os.c

include $(BUILD_SHARED_LIBRARY)

and while compiling, I get the following error

"Compile thumb : dsp-message <= message.c

"Compile thumb : dsp-message <= message_os.c

SharedLibrary  : libdsp-message.so

C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `DRV_Initialize':
_sync_usr.c:(.text+0xb10): undefined reference to `getpagesize' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `DRV_ProtectInit':
**_sync_usr.c:(.text+0x24b4): undefined reference to `semget'**
_sync_usr.c:(.text+0x24d4): undefined reference to `__errno_location'
_sync_usr.c:(.text+0x24f4): undefined reference to `semget'
_sync_usr.c:(.text+0x2538): undefined reference to `semctl' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `DRV_ProtectExit':
_sync_usr.c:(.text+0x25dc): undefined reference to `semctl' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `DRV_ProtectEnter':
_sync_usr.c:(.text+0x26b4): undefined reference to `semop'
_sync_usr.c:(.text+0x26c4): undefined reference to `__errno_location' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `DRV_ProtectLeave':
_sync_usr.c:(.text+0x2800): undefined reference to `semop' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `DRV_installCleanupRoutines':
_sync_usr.c:(.text+0x2898): undefined reference to `sigemptyset'
_sync_usr.c:(.text+0x28a4): undefined reference to `sigfillset' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `NOTIFY_eventWorker':
_sync_usr.c:(.text+0x7ee4): undefined reference to `sigfillset' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `_SYNC_USR_init':
_sync_usr.c:(.text+0x13ca8): undefined reference to `semget'
_sync_usr.c:(.text+0x13d30): undefined reference to `semctl' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `_SYNC_USR_exit':
_sync_usr.c:(.text+0x13e34): undefined reference to `semget'
_sync_usr.c:(.text+0x13e84): undefined reference to `semctl' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `_SYNC_USR_createCS':
_sync_usr.c:(.text+0x14008): undefined reference to `semget'
_sync_usr.c:(.text+0x14020): undefined reference to `__errno_location' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `_SYNC_USR_enterCS':
_sync_usr.c:(.text+0x14358): undefined reference to `semop'
_sync_usr.c:(.text+0x14368): undefined reference to `__errno_location' C:/NDK/android-ndk-r8/samples/two-libs//jni/dsplink.a(dsplink.o): In
function `_SYNC_USR_leaveCS':
_sync_usr.c:(.text+0x144a0): undefined reference to `semop' collect2: ld returned 1 exit status 

make: ***
[C:/NDK/android-ndk-r8/samples/two-libs//obj/local/armeabi/libdsp-message.so]
Error 1

No correct solution

OTHER TIPS

I had complaints about semget last February when I was trying to build the dsplink samples for the console. My errors look similar to your undefined references. I found out that my errors were due to me trying to build the dsplink using the libc provided with the standard Android rowboat project. When I replaced the bionic libc from the Gingerbread 2.3.4 sources distribution with the libc from the TI DSP sources, it resolved all of my libc reference errors. From this experience it seems that there is more support for semaphores in the C library used with the DSP code base than there is in the basic Android bionic library.

Suggestion: I would make sure that the C library which your Android.mk build is pointing to for linking is the C library provided for the DSP project and not the default Android bionic libc.

That should resolve some or most of your undefined references, but I'm not sure if there are any other problems in your Android.mk.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top