< Previous by Date Date Index Next by Date >
  Thread Index  

[reSIProcate] Failed to compile resip for Android when IPv6 enabled.


I'm using "./build/android-custom-ndk" to compile the resip 1.9.7 for Android,
It's compile successfully for IPv4, but if I added the "--enable-ipv6" option to "android-custom-ndk":
./configure \
--libdir=/libs/${MOD_NAME} \
--host=${CROSS_COMPILE} \
--with-sysroot=${SYSROOT} \
--enable-android \
--enable-ipv6 \
--with-ssl \
"$@"

I got below error:

======================================================

ares_init.c: In function 'init_by_defaults_andriod_nameservers':
ares_init.c:496:78: error: 'struct in6_addr' has no member named 's_addr'
ares_init.c:459:9: warning: unused variable 'prop_name' [-Wunused-variable]
ares_init.c: At top level:
ares_init.c:1184:12: warning: 'find_server' defined but not used [-Wunused-function]
ares_init.c:1210:12: warning: 'find_server6' defined but not used [-Wunused-function]
make[1]: *** [ares_init.lo] Error 1

=================================================

I'm tried to fix it, edit the ares_init.c, in line 496:
change rc = inet_pton(AF_INET6, props_dns[i], &channel->servers[j].addr6.s_addr);

to 

rc = inet_pton(AF_INET6, props_dns[i], &channel->servers[j].addr6.s6_addr);

Then got another error:


==========================================================

In file included from DnsUtil.cxx:22:0:
../rutil/compat.hxx:270:2: warning: #warning IPv6 support requested, but IPPROTO_IPV6 undefined; this platform does not appear to support IPv6 [-Wcpp]
DnsUtil.cxx:248:1: error: prototype for 'resip::Data resip::DnsUtil::inet_ntop(const in6_addr&)' does not match any in class 'resip::DnsUtil'
../rutil/DnsUtil.hxx:119:27: error: candidates are: static char const* resip::DnsUtil::inet_ntop(int, void const*, char*, size_t)
../rutil/DnsUtil.hxx:76:19: error:                 static resip::Data resip::DnsUtil::inet_ntop(const sockaddr&)
DnsUtil.cxx:239:1: error:                 static resip::Data resip::DnsUtil::inet_ntop(const in_addr&)
DnsUtil.cxx: In static member function 'static resip::Data resip::DnsUtil::inet_ntop(const sockaddr&)':
DnsUtil.cxx:263:49: error: no matching function for call to 'resip::DnsUtil::inet_ntop(const in6_addr&)'
DnsUtil.cxx:263:49: note: candidates are:
DnsUtil.cxx:239:1: note: static resip::Data resip::DnsUtil::inet_ntop(const in_addr&)
DnsUtil.cxx:239:1: note:   no known conversion for argument 1 from 'const in6_addr' to 'const in_addr&'
DnsUtil.cxx:257:1: note: static resip::Data resip::DnsUtil::inet_ntop(const sockaddr&)
DnsUtil.cxx:257:1: note:   no known conversion for argument 1 from 'const in6_addr' to 'const sockaddr&'
../rutil/DnsUtil.hxx:119:27: note: static char const* resip::DnsUtil::inet_ntop(int, void const*, char*, size_t)
../rutil/DnsUtil.hxx:119:27: note:   candidate expects 4 arguments, 1 provided
DnsUtil.cxx: At global scope:
DnsUtil.cxx:281:1: error: prototype for 'int resip::DnsUtil::inet_pton(const resip::Data&, in6_addr&)' does not match any in class 'resip::DnsUtil'
../rutil/DnsUtil.hxx:135:18: error: candidates are: static int resip::DnsUtil::inet_pton(int, char const*, void*)
DnsUtil.cxx:274:1: error:                 static int resip::DnsUtil::inet_pton(const resip::Data&, in_addr&)
DnsUtil.cxx: In static member function 'static resip::Data resip::DnsUtil::canonicalizeIpV6Address(const resip::Data&)':
DnsUtil.cxx:430:49: error: no matching function for call to 'resip::DnsUtil::inet_pton(const resip::Data&, in6_addr&)'
DnsUtil.cxx:430:49: note: candidates are:
DnsUtil.cxx:274:1: note: static int resip::DnsUtil::inet_pton(const resip::Data&, in_addr&)
DnsUtil.cxx:274:1: note:   no known conversion for argument 2 from 'in6_addr' to 'in_addr&'
../rutil/DnsUtil.hxx:135:18: note: static int resip::DnsUtil::inet_pton(int, char const*, void*)
../rutil/DnsUtil.hxx:135:18: note:   candidate expects 3 arguments, 2 provided
DnsUtil.cxx:443:33: error: no matching function for call to 'resip::DnsUtil::inet_ntop(in6_addr&)'
DnsUtil.cxx:443:33: note: candidates are:
DnsUtil.cxx:239:1: note: static resip::Data resip::DnsUtil::inet_ntop(const in_addr&)
DnsUtil.cxx:239:1: note:   no known conversion for argument 1 from 'in6_addr' to 'const in_addr&'
DnsUtil.cxx:257:1: note: static resip::Data resip::DnsUtil::inet_ntop(const sockaddr&)
DnsUtil.cxx:257:1: note:   no known conversion for argument 1 from 'in6_addr' to 'const sockaddr&'
../rutil/DnsUtil.hxx:119:27: note: static char const* resip::DnsUtil::inet_ntop(int, void const*, char*, size_t)
../rutil/DnsUtil.hxx:119:27: note:   candidate expects 4 arguments, 1 provided
../rutil/Data.hxx: At global scope:
../rutil/Data.hxx:1005:13: warning: 'resip::invokeDataInit' defined but not used [-Wunused-variable]
make[1]: *** [DnsUtil.lo] Error 1

============================================================


How to fix the errors?

Thanks,