cURL / Mailing Lists / curl-users / Single Mail

curl-users

Error compiling apps that use curl.h on Solaris with curl 7.17.1

From: Georg Horn <horn_at_koblenz-net.de>
Date: Tue, 04 Dec 2007 16:14:19 +0100

Hi,

i ran into an error compiling the examples or any other app that
includes curl.h on an older Solaris system:

$ uname -a
SunOS luna 5.6 Generic_105181-35 sun4u sparc SUNW,UltraSPARC-IIi-cEngine

$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs
gcc version 2.95.2 19991024 (release)

In directory docs/examples:

$ make
source='10-at-a-time.c' object='10-at-a-time.o' libtool=no \
DEPDIR=.deps depmode=gcc /bin/ksh ../../depcomp \
gcc -DHAVE_CONFIG_H -I../../include -DCURL_NO_OLDIES -g -O2 -c
10-at-a-time.c
In file included from ../../include/curl/multi.h:50,
                  from 10-at-a-time.c:20:
../../include/curl/curl.h:254: parse error before `socklen_t'
../../include/curl/curl.h:254: warning: no semicolon at end of struct or
union
../../include/curl/curl.h:257: parse error before `}'
make: *** [10-at-a-time.o] Error 1

socklen_t can not be found in any include file on the whole machine, so
i quickly fixed the problem by replacing socklen_t with size_t on line
254 of curl.h

Perhaps this is not a portable solution for all platforms, so maybe a
check for socklen_t should be included into the next curl version.

Bye,
Georg
Received on 2007-12-04