我在 android omapl138 board 上运行了 dsplink 应用程序。我可以在终端中运行该应用程序。我已将 dsplink 应用程序包含在 ndk 中,并尝试使用以下方法进行编译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)
在编译时,我收到以下错误
"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