delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/05/21/18:12:57

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=iXi
d/NIOssETNVuEVmDuLvFR1/3TDB2RMXtiX1wMEtJv2yDfxdHzrtgi2Ysix5V4Hf4
mC+M50E/SD+6NjiIpp86dTbLK/rUKosG1Dq7HM/jUydEseC2kz8z0W31wRdDPpCq
se03PesV4ZYoEFpLHieZ1IBcpjxHOd8y9Pvl6xr4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:mime-version
:content-type:content-transfer-encoding; s=default; bh=Fd/qIWSp1
/zrWv7dQzM+PeYRW4I=; b=yMiw5/bz9SKN6GF6VgNhRNCcr2rqg4re5udeSGEjN
8ERiPf5W3dIDI4j8sDRbPFLSUwabLnoaQn3VFNFBCRLCWcmX2XKrg7JdZSXm7yk4
pHS4Ie0TaHNZznXDGv3Kd7xZkQm6XcfmaaPQ7F2JTqqzr2GMO+8e/rnQwslEH3bX
lY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: Yes, score=5.8 required=5.0 tests=AWL,BAYES_20,BODY_8BITS,GARBLED_BODY,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no version=3.3.2
X-HELO: mout.perfora.net
From: "James Johnston" <JamesJ AT motionview3d DOT com>
To: <cygwin AT cygwin DOT com>
Subject: Error compiling cygwin 2.0.2-1: conflicting if_nametoindex declarations
Date: Thu, 21 May 2015 22:12:24 -0000
Message-ID: <014e01d09413$37ad2d10$a7078730$@motionview3d.com>
MIME-Version: 1.0
X-UI-Out-Filterresults: notjunk:1;
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t4LMCpIp013803

Hi,

I’m trying to compile 32-bit Cygwin 2.0.2 from source on a clean installation of Cygwin, but I’m running into a problem – it won’t compile due to this error:

c++wrap -O2 -g -fno-rtti -fno-exceptions -fno-use-cxa-atexit -Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0 -MMD -Werror -fmerge-constants -ftracer -c -o net.o ../../../../newlib-cygwin/winsup/cygwin/net.cc
../../../../newlib-cygwin/winsup/cygwin/net.cc: In function ‘unsigned int if_nametoindex(const char*)’:
../../../../newlib-cygwin/winsup/cygwin/net.cc:2448:33: error: conflicting declaration of C function ‘unsigned int if_nametoindex(const char*)’
 if_nametoindex (const char *name)
                                 ^
In file included from /usr/include/w32api/iphlpapi.h:170:0,
                 from ../../../../newlib-cygwin/winsup/cygwin/net.cc:34:
/usr/include/w32api/netioapi.h:374:29: note: previous declaration ‘NET_IFINDEX if_nametoindex(PCSTR)’
   NET_IFINDEX NETIOAPI_API_ if_nametoindex (PCSTR InterfaceName);
                             ^
../../../../newlib-cygwin/winsup/cygwin/net.cc: In function ‘char* if_indextoname(unsigned int, char*)’:
../../../../newlib-cygwin/winsup/cygwin/net.cc:2481:47: error: conflicting declaration of C function ‘char* if_indextoname(unsigned int, char*)’
 if_indextoname (unsigned ifindex, char *ifname)
                                               ^
In file included from /usr/include/w32api/iphlpapi.h:170:0,
                 from ../../../../newlib-cygwin/winsup/cygwin/net.cc:34:
/usr/include/w32api/netioapi.h:375:23: note: previous declaration ‘CHAR* if_indextoname(NET_IFINDEX, PCHAR)’
   PCHAR NETIOAPI_API_ if_indextoname (NET_IFINDEX InterfaceIndex, PCHAR InterfaceName);
                       ^
../../../../newlib-cygwin/winsup/cygwin/../Makefile.common:43: recipe for target 'net.o' failed


Examining the source for net.cc, I note the following comments at the top:

/* FIXME: Collision with different declarations of if_nametoindex and
	  if_indextoname functions in iphlpapi.h since Vista.
   TODO:  Convert if_nametoindex to cygwin_if_nametoindex and call
	  system functions on Vista and later. */

Huh?  Further examination shows that there is indeed a conflict.  But I examined the commit history in net.cc and it looks like nobody has changed anything related to this for years in that file.  The comment itself is quite old.  I'm a little amazed it's been working before.  What am I missing here to get Cygwin building?

One other minor quibble/note: I had to install texinfo package to get the build going; this isn't currently noted in the FAQ as a requirement.

Best regards,

James Johnston



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019