public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Error compiling cygwin 2.0.2-1: conflicting if_nametoindex declarations
@ 2015-05-21 23:05 James Johnston
  2015-05-22 13:14 ` Takashi Yano
  0 siblings, 1 reply; 2+ messages in thread
From: James Johnston @ 2015-05-21 23:05 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Error compiling cygwin 2.0.2-1: conflicting if_nametoindex declarations
  2015-05-21 23:05 Error compiling cygwin 2.0.2-1: conflicting if_nametoindex declarations James Johnston
@ 2015-05-22 13:14 ` Takashi Yano
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Yano @ 2015-05-22 13:14 UTC (permalink / raw)
  To: cygwin

On Thu, 21 May 2015 22:12:24 -0000
"James Johnston" wrote:

> 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:

See: http://cygwin.com/ml/cygwin/2015-05/msg00303.html

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

--
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-22 11:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21 23:05 Error compiling cygwin 2.0.2-1: conflicting if_nametoindex declarations James Johnston
2015-05-22 13:14 ` Takashi Yano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).