cURL / Mailing Lists / curl-library / Single Mail


HP-UX, Unsatisfied symbols: if_nametoindex // Patch included

From: <>
Date: Thu, 5 Jun 2014 00:07:29 +0200


I compiled curl-7.37.0 on Linux, Solaris, HP-UX, AIX and Cygwin.
It works nearly without any problems. ;)

On our old HP-UX 11.11 machine, there was a little problem in the last link step:

libtool: link: gcc -g -O0 -pedantic -Wall -W -Wpointer-arith -Wwrite-strings -Wunused -Wshadow -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-
long-long -Wfloat-equal -Wno-multichar -Wsign-compare -Wundef -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wno-system-headers
-o curl curl-tool_binmode.o curl-tool_bname.o curl-tool_cb_dbg.o curl-tool_cb_hdr.o curl-tool_cb_prg.o curl-tool_cb_rea.o curl-tool_cb_see.o curl-tool_cb_wrt.o curl-tool_
cfgable.o curl-tool_convert.o curl-tool_dirhie.o curl-tool_doswin.o curl-tool_easysrc.o curl-tool_formparse.o curl-tool_getparam.o curl-tool_getpass.o curl-tool_help.o cu
rl-tool_helpers.o curl-tool_homedir.o curl-tool_hugehelp.o curl-tool_libinfo.o curl-tool_main.o curl-tool_metalink.o curl-tool_mfiles.o curl-tool_msgs.o curl-tool_operate
.o curl-tool_operhlp.o curl-tool_panykey.o curl-tool_paramhlp.o curl-tool_parsecfg.o curl-tool_setopt.o curl-tool_sleep.o curl-tool_urlglob.o curl-tool_util.o curl-tool_v
ms.o curl-tool_writeenv.o curl-tool_writeout.o curl-tool_xattr.o ../lib/curl-strtoofft.o ../lib/curl-strdup.o ../lib/curl-rawstr.o ../lib/curl-nonblock.o ../lib/curl-warn
less.o -L/ae/cc/uzkto/curl/lib ../lib/.libs/libcurl.a -lssl -lcrypto -lz
/usr/ccs/bin/ld: Unsatisfied symbols:
   if_nametoindex (code)
collect2: ld returned 1 exit status
gmake[2]: *** [curl] Error 1
gmake[2]: Leaving directory `/ae/cc/uzkto/curl-7.37.0/src'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/ae/cc/uzkto/curl-7.37.0/src'
gmake: *** [all-recursive] Error 1

curl-7.37.0>grep IFNAMSIZ /usr/include/net/if.h
#define IFNAMSIZ 16
        char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
   char lifr_target[IFNAMSIZ];
   char lifr_source[IFNAMSIZ];
        char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */

curl-7.37.0>grep if_indextoname /usr/include/net/if.h # function seems to be missing

curl-7.37.0>uname -a
HP-UX UZKTO B.11.11 U 9000/800 849920641 unlimited-user license

curl-7.37.0>diff -c lib/url.c.orig lib/url.c
*** lib/url.c.orig Wed Jun 4 23:42:28 2014
--- lib/url.c Wed Jun 4 23:40:53 2014
*** 4004,4010 ****
        else {
          /* Zone identifier is not numeric */
! #if defined(HAVE_NET_IF_H) && defined(IFNAMSIZ)
          char ifname[IFNAMSIZ + 2];
          char *square_bracket;
          unsigned int scopeidx = 0;
--- 4004,4010 ----
        else {
          /* Zone identifier is not numeric */
! #if defined(HAVE_NET_IF_H) && defined(IFNAMSIZ) && defined(if_nametoindex)
          char ifname[IFNAMSIZ + 2];
          char *square_bracket;
          unsigned int scopeidx = 0;


I don't know, if 11.11 supports IPv6, so it seems to be a solution for me.


Deutsche Telekom AG
Seamless ICT Security Infrastructure & Management im Auftrag T-Systems International GmbH
Dipl. Inf Alexander Elgert Langwadener Strasse 17 64625 Bensheim
List admin:
Received on 2014-06-05