Operating System - Linux
1752749 Members
4885 Online
108789 Solutions
New Discussion юеВ

Compile problems with GSOAP and GCC on HPUX11.11 (11i)

 
James Beamish-White_1
Occasional Advisor

Compile problems with GSOAP and GCC on HPUX11.11 (11i)

Hi all,

I am finding it impossible to compile gsoap on HPUX 11.11. HELP! :-)


This is the script I use to do the configure:

host:/var/tmp/gsoap-2.7>cat gsoap-compile

UNIX_STD="98" ;export UNIX_STD

CFLAGS="-O -D_XOPEN_SOURCE=500 -I/usr/local/lib/gcc/hppa2.0w-hp-hpux11.11/4.0.2/include -I/usr/local/include -I/usr/include -lCsup"
LDFLAGS="-L/usr/local/lib"

./configure



This is the error:

gmake all-recursive
gmake[1]: Entering directory `/var/tmp/gsoap-2.7'
Making all in soapcpp2
gmake[2]: Entering directory `/var/tmp/gsoap-2.7/soapcpp2'
ln -s stdsoap2.cpp stdsoap2_cpp.cpp
source='stdsoap2.c' object='libgsoap_a-stdsoap2.o' libtool=no \
depfile='.deps/libgsoap_a-stdsoap2.Po' tmpdepfile='.deps/libgsoap_a-stdsoap2.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DHP_UX -g -O2 -c -o libgsoap_a-stdsoap2.o `test -f 'stdsoap2.c' || echo './'`stdsoap2.c
stdsoap2.c: In function 'tcp_connect':
stdsoap2.c:3261: warning: passing argument 5 of 'getsockopt' from incompatible pointer type
stdsoap2.c: In function 'tcp_accept':
stdsoap2.c:3668: warning: passing argument 3 of 'accept' from incompatible pointer type
rm -f libgsoap.a
ar cru libgsoap.a libgsoap_a-stdsoap2.o
ranlib libgsoap.a
source='stdsoap2_cpp.cpp' object='libgsoap___a-stdsoap2_cpp.o' libtool=no \
depfile='.deps/libgsoap___a-stdsoap2_cpp.Po' tmpdepfile='.deps/libgsoap___a-stdsoap2_cpp.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I.. -DHP_UX -g -O2 -c -o libgsoap___a-stdsoap2_cpp.o `test -f 'stdsoap2_cpp.cpp' || echo './'`stdsoap2_cpp.cpp
stdsoap2_cpp.cpp: In function 'int tcp_connect(soap*, const char*, const char*, int)':
stdsoap2_cpp.cpp:3261: error: invalid conversion from 'int*' to 'socklen_t*'
stdsoap2_cpp.cpp:3261: error: initializing argument 5 of 'int getsockopt(int, int, int, void*, socklen_t*)'
stdsoap2_cpp.cpp: In function 'int tcp_accept(soap*, int, sockaddr*, int*)':
stdsoap2_cpp.cpp:3668: error: invalid conversion from 'int*' to 'socklen_t*'
stdsoap2_cpp.cpp:3668: error: initializing argument 3 of 'int accept(int, sockaddr*, socklen_t*)'
gmake[2]: *** [libgsoap___a-stdsoap2_cpp.o] Error 1
gmake[2]: Leaving directory `/var/tmp/gsoap-2.7/soapcpp2'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/var/tmp/gsoap-2.7'
gmake: *** [all] Error 2



I have done loads of research into the error re: getsockopt. Most talk about either the hp-linux porting (-lhplx) or the Unix95/98 standard, but I have tried both and and I'm at a loss.


I have all the GCC dependencies (bison, m4, make etc) as depots off http://hpux.connect.org.uk/.


Here are my paths and other info:

host:/var/tmp/gsoap-2.7>echo $PATH
/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/resmon/bin:/opt/pd/bin:/opt/gnome/bin:/opt/perf/bin:/usr/bin/X11:/usr/contrib/bin/X11:/usr/sbin/diag/contrib:/opt/wbem/bin:/opt/wbem/sbin:/opt/graphics/common/bin:/opt/mx/bin:/opt/perl/bin:/opt/prm/bin:/opt/wlm/bin:/sbin:/home/root:/usr/storapi/bin:usr/storapi/storbin:/opt/Navisphere/bin

host:/var/tmp/gsoap-2.7>echo $SHLIB_PATH
/usr/local/lib:/usr/lib:/usr/lib/X11R5:/opt/Navisphere/lib

host:/var/tmp/gsoap-2.7>gcc --version
gcc (GCC) 4.0.2
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

host:/var/tmp/gsoap-2.7>uname -a
HP-UX host B.11.11 U 9000/800 1575730528 unlimited-user license

host:/var/tmp/gsoap-2.7>swlist -l patch | egrep 'ld|libc'
# PHCO_29029 1.0 libc cumulative patch
# PHCO_31923 1.0 libc cumulative header file patch
# PHSS_30970 1.0 ld(1) and linker tools cumulative patch


Any help would be GREATLY appreciated.

Regards,
J
7 REPLIES 7
Stephen Keane
Honored Contributor

Re: Compile problems with GSOAP and GCC on HPUX11.11 (11i)

Looking at the gSOAP header files, your problem appears to be that SOAP_SOCKLEN_T is being set incorrectly.

It should be set as follows

# define SOAP_SOCKLEN_T int

But it appears to be set as

# define SOAP_SOCKLEN_T socklen_t

The bit which does the setting is in the header files (e.g. stdsoap2.h) which occur all over the place. The bit which does the setting is

/* Portability: define SOAP_SOCKLEN_T */
#if defined(SOCKLEN_T)
# define SOAP_SOCKLEN_T SOCKLEN_T
#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN) ||
defined(FREEBSD) || defined(__FreeBSD__) || defined(__QNX__) || defined(QNX) ||
defined(_AIX)
# define SOAP_SOCKLEN_T socklen_t
#elif defined(IRIX) || defined(WIN32) || defined(__APPLE__) || defined(HP_UX) ||
defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS)
# define SOAP_SOCKLEN_T int
#else
# define SOAP_SOCKLEN_T size_t
#endif

Which suggests to me that something else is defining one of the following

__socklen_t_defined, _SOCKLEN_T, CYGWIN, FREEBSD, __FreeBSD__, __QNX__, QNX, or _AIX.

Perhaps you could do a find of /usr/include and /usr/local/include to see if they are being set? I don't have the same packages installed as yourself, so I can't find any instances.
James Beamish-White_1
Occasional Advisor

Re: Compile problems with GSOAP and GCC on HPUX11.11 (11i)

It doesn't look like it:

egrep -i "__socklen_t_defined|_SOCKLEN_T|CYGWIN|FREEBSD|__FreeBSD__|__QNX__|QNX|_AIX" /usr/include/* /usr/local/include/*

/usr/local/include/ansidecl.h:#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus))
/usr/local/include/libintl.h:# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
/usr/local/include/ltdl.h:#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
/usr/local/include/ltdl.h:/* Canonicalise Windows and Cygwin recognition macros. */
/usr/local/include/ltdl.h:#ifdef __CYGWIN32__
/usr/local/include/ltdl.h:# ifndef __CYGWIN__
/usr/local/include/ltdl.h:# define __CYGWIN__ __CYGWIN32__
/usr/local/include/ltdl.h:# ifndef __CYGWIN__
/usr/local/include/tcl.h: * This block is skipped under Cygwin and Mingw.
/usr/local/include/tcl.h:# if defined(__WIN32__) && !defined(__CYGWIN__)
/usr/local/include/tclPlatDecls.h:#if defined(__CYGWIN__)
/usr/local/include/tclUnixPort.h:#ifdef _AIX
/usr/local/include/tclUnixPort.h:# ifndef _AIX
/usr/include/arm.h:#if defined(__hpux) || defined(_AIX) || defined(_SUN) || defined (_LINUX)


Ermin Borovac
Honored Contributor

Re: Compile problems with GSOAP and GCC on HPUX11.11 (11i)

If you look at the man page for getsockopt(2), you'll find the function declaration reads

int getsockopt(
int s,
int level,
int optname,
void *optval,
int *optlen
);

but for _XOPEN_SOURCE_EXTENDED (UNIX98) mode
int getsockopt(
int s,
int level,
int optname,
void *optval,
socklen_t *optlen
);

So I suggest that you undefine _XOPEN_SOURCE_EXTENDED maybe in CFLAGS

$ export CFLAGS="-U_XOPEN_SOURCE_EXTENDED"

That will probably get you further but you may get undefined reference to strtoull. strtoull can be replaced with sscanf (i.e. use %llu format string in sscanf).
davidbrook
New Member

Re: Compile problems with GSOAP and GCC on HPUX11.11 (11i)

hi James,

Did it work ? I encount the same error.
And I am not familiar with c program under hpux.If you success, can you tell me? jianhe.zhang@hp.com 3x.
James Beamish-White_1
Occasional Advisor

Re: Compile problems with GSOAP and GCC on HPUX11.11 (11i)

In the end, I reversed most of my changes, and instead got a copy of strtoull.c, compiled it and included it in the build.

I'll update more details tomorrow.

James
Steven E. Protter
Exalted Contributor

Re: Compile problems with GSOAP and GCC on HPUX11.11 (11i)

Shalom J,

Its common to have to make minor code or header file adjustments to get code to work with HP-UX.

Your final approach is on the right track, if I am right.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James Beamish-White_1
Occasional Advisor

Re: Compile problems with GSOAP and GCC on HPUX11.11 (11i)

Attached is the copy of strtoull.c that I used.

I can't quite remember how I did it, but it's something along the lines of:

- Compile it into an onject file but don't link it (gcc -g -Wall -c strtoull.c), into the gsoap directory.
- If it doesn't make naturally, add it to the Makefile.

Cheers,
James