I have nanomsg and Android.mk from here. I try to build it for Android with Android NDK. And I have error:
[armeabi] Compile thumb : nano <= usock.c
In file included from /home/roman/work/Nano/app/jni/src/aio/usock.c:28:0:
/home/roman/work/Nano/app/jni/src/aio/usock_posix.inc: In function 'nn_usock_recv_raw':
/home/roman/work/Nano/app/jni/src/aio/usock_posix.inc:1112:8: error: 'struct msghdr' has no member named 'msg_accrights'
hdr.msg_accrights = ctrl;
^
/home/roman/work/Nano/app/jni/src/aio/usock_posix.inc:1113:8: error: 'struct msghdr' has no member named 'msg_accrightslen'
hdr.msg_accrightslen = sizeof (int);
^
In file included from /home/roman/work/Nano/app/jni/src/aio/usock.c:28:0:
/home/roman/work/Nano/app/jni/src/aio/usock_posix.inc:1151:16: error: 'struct msghdr' has no member named 'msg_accrightslen'
if (hdr.msg_accrightslen > 0) {
^
/home/roman/work/Nano/app/jni/src/aio/usock_posix.inc:1152:46: error: 'struct msghdr' has no member named 'msg_accrightslen'
nn_assert (hdr.msg_accrightslen == sizeof (int));
^
In file included from /home/roman/work/Nano/app/jni/src/aio/usock.c:28:0:
/home/roman/work/Nano/app/jni/src/aio/usock_posix.inc:1154:45: error: 'struct msghdr' has no member named 'msg_accrights'
*self->in.pfd = *((int*) hdr.msg_accrights);
^
/home/roman/work/Nano/app/jni/src/aio/usock_posix.inc:1158:41: error: 'struct msghdr' has no member named 'msg_accrights'
nn_closefd (*((int*) hdr.msg_accrights));
^
make: *** [/home/roman/work/Nano/app/obj/local/armeabi/objs/nano/src/aio/usock.o] Error 1
What is problem? I hope anybody can help.
On your Android.mk file replace your
LOCAL_CFLAGS with these lines
and these two lines also.
For more reference check below link:
https://gist.github.com/kroggen/ff49ad06e78754068be6/revisions