0

I have to include a static native library (dsplink.a) which uses System V IPCs in android ndk project.

Including my library in android.mk as,

    LOCAL_LDLIBS := ($MY-PATH)/dsplink.a

gives the following error:

    _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'

semctl,semget,.. functions are included from sys/sem.h. Is there any way to include the library ?

4

1 に答える 1

1

Sadly it isn't possible.

Extraction from android-ndk-r8/docs/system/libc/SYSV-IPC.html

Android does not support System V IPCs, i.e. the facilities provided by the following standard Posix headers:

<sys/sem.h>   /* SysV semaphores */
<sys/shm.h>   /* SysV shared memory segments */
<sys/msg.h>   /* SysV message queues */
<sys/ipc.h>   /* General IPC definitions */

The reason for this is due to the fact that, by design, they lead to global kernel resource leakage.

于 2012-07-04T09:31:20.957 に答える