This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Error compiling cygwin 2.0.2-1: conflicting if_nametoindex declarations


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]