有用 android NDK 成功编译[Redsocks2]: https://github.com/semigodking/redsocks 的么? 我按照 github 上 WIKI 上的[编译方法] :https://github.com/semigodking/redsocks/wiki/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8Android-NDK%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91redsocks2 找到那几个.c 文件,并且按照上面的方法进行了操作,但是 ndk-build 的时候出现了以下错误。
[armeabi] Compile thumb : redsocks <= main.c
/opt/src/redsocks/android/jni/openssl/ssl/../../../../main.c: In function 'wait_for_network':
/opt/src/redsocks/android/jni/openssl/ssl/../../../../main.c:95:25: error: 'IPPROTO_TCP' undeclared (first use in this function)
hints.ai_protocol = IPPROTO_TCP; /* We want a TCP socket /
^
/opt/src/redsocks/android/jni/openssl/ssl/../../../../main.c:95:25: note: each undeclared identifier is reported only once for each function it appears in /usr/local/android-ndk/build/core/build-binary.mk:472: recipe for target '/opt/src/redsocks/android/obj/local/armeabi/objs/redsocks/main.o' failed
make: ** [/opt/src/redsocks/android/obj/local/armeabi/objs/redsocks/main.o] Error 1
各位 V 友有什么解决方法么? 1
rphoho 2016-08-19 23:05:49 +08:00
proxydroid 里的有,编得过。
|
2
allenforrest 2016-08-19 23:11:24 +08:00
想省事:
#define IPPROTO_TCP 6 /* tcp */ |
4
xseven007 OP @allenforrest main.c 过了,然后后面又出现了一系列的问题
/opt/src/redsocks/android/jni/openssl/ssl/../../../../redudp.c:159:13: warning: 'bound_udp4_put' defined but not used [-Wunused-function] static void bound_udp4_put(const struct sockaddr_in *addr) ^ /usr/local/android-ndk/build/core/build-binary.mk:472: recipe for target '/opt/src/redsocks/android/obj/local/armeabi/objs/redsocks/redudp.o' failed |
5
xseven007 OP @allenforrest 应该是 alltypes.h 的问题,但是换成某个 arm 的 alltypes.h 之后又会出现
In file included from /opt/src/redsocks/android/jni/openssl/ssl/../../../../socks5-udp.c:26:0: /opt/src/redsocks/android/jni/openssl/ssl/../../../../redudp.h:29:21: error: field 'bindaddr' has incomplete type struct sockaddr_in bindaddr; ^ /opt/src/redsocks/android/jni/openssl/ssl/../../../../redudp.h:30:21: error: field 'relayaddr' has incomplete type struct sockaddr_in relayaddr; ^ /opt/src/redsocks/android/jni/openssl/ssl/../../../../redudp.h:32:21: error: field 'destaddr' has incomplete type struct sockaddr_in destaddr; ^ /opt/src/redsocks/android/jni/openssl/ssl/../../../../redudp.h:53:22: error: field 'clientaddr' has incomplete type struct sockaddr_in clientaddr; ^ /opt/src/redsocks/android/jni/openssl/ssl/../../../../redudp.h:54:22: error: field 'destaddr' has incomplete type struct sockaddr_in destaddr; ^ /opt/src/redsocks/android/jni/openssl/ssl/../../../../redudp.h:66:21: error: field 'destaddr' has incomplete type struct sockaddr_in destaddr; ^ /usr/local/android-ndk/build/core/build-binary.mk:472: recipe for target '/opt/src/redsocks/android/obj/local/armeabi/objs/redsocks/socks5-udp.o' failed make: *** [/opt/src/redsocks/android/obj/local/armeabi/objs/redsocks/socks5-udp.o] Error 1 |
6
wohenyingyu01 2016-08-20 13:17:56 +08:00 via iPhone
没有 include <netinet/in.h>头文件
|
7
xseven007 OP @wohenyingyu01 已经 include 了的
|