error: cannot convert 'hostent**' to 'int*' for argument '5' to 'hostent*...
Development toolkit for Web Services and XML data bindings for C & C++
Brought to you by:
engelen
On OpenIndiana 2018.10 (illumos-ee4417888c) gSOAP 2.8.83 compilation with GCC 6.5.0 fails with
/bin/bash ../libtool --tag=CXX --mode=compile /usr/gcc/6/bin/g++ -DHAVE_CONFIG_H -I. -I.. -DWITH_IPV6 -DSUN_OS -DWITH_COOKIES -m64 -O3 -MT libgsoapck___la-stdsoap2_ck_cpp.lo -MD -MP -MF .deps/libgsoapck___la-stdsoap2_ck_cpp.Tpo -c -o libgsoapck___la-stdsoap2_ck_cpp.lo `test -f 'stdsoap2_ck_cpp.cpp' || echo './'`stdsoap2_ck_cpp.cpp
libtool: compile: /usr/gcc/6/bin/g++ -DHAVE_CONFIG_H -I. -I.. -DWITH_IPV6 -DSUN_OS -DWITH_COOKIES -m64 -O3 -MT libgsoapck___la-stdsoap2_ck_cpp.lo -MD -MP -MF .deps/libgsoapck___la-stdsoap2_ck_cpp.Tpo -c stdsoap2_ck_cpp.cpp -fPIC -DPIC -o .libs/libgsoapck___la-stdsoap2_ck_cpp.o
stdsoap2_ck_cpp.cpp: In function 'int tcp_gethostbyname(soap*, const char*, hostent*, in_addr*)':
stdsoap2_ck_cpp.cpp:5098:85: error: cannot convert 'hostent**' to 'int*' for argument '5' to 'hostent* gethostbyname_r(const char*, hostent*, char*, int, int*)'
while ((r = gethostbyname_r(addr, hostent, tmpbuf, tmplen, &hostent, &soap->errnum)) < 0)
^
Our GETHOSTBYNAME(3NSL) says:
struct hostent gethostbyname_r(const char name,
struct hostent result, char buffer, int buflen,
int *h_errnop);
Simmilar ticket: https://sourceforge.net/p/gsoap2/bugs/1246/.
Unfortunately, this is a very difficult issue to fix because we did not yet find a reliable way to detect which of the two or three versions of
gethostbyname_ris supported by a platform, and sources like stackoverflow are not helpful (yet). We tried three different approaches. For each we pissed off someone by failing their builds. Please see the notes https://sourceforge.net/p/gsoap2/bugs/1246/ and modify the#ifdeftest to see what works for you. Perhaps you can include in your post the full list of macros defined on your platform and compiler to see which ones affect the test positively and negatively. See also https://sourceforge.net/p/gsoap2/bugs/1238/