`portupgrade :licq' generate errors : In file included from licq.cpp:29: /usr/local/include/getopt.h:115: declaration of C function `int getopt()' conflicts with /usr/include/unistd.h:377: previous declaration `int getopt(int, char* const*, const char*)' here /usr/local/include/getopt.h: In member function `bool CLicq::Init(int, char**)': /usr/local/include/getopt.h:115: too many arguments to function `int getopt()' licq.cpp:189: at this point in file gmake[2]: *** [licq.o] ïÛÉÂËÁ 1 gmake[2]: Leaving directory `/var/.0/tmp/mnt/digma/usr/ports/net/licq/work/licq-1.2.7/src' gmake[1]: *** [all-recursive] ïÛÉÂËÁ 1 gmake[1]: Leaving directory `/var/.0/tmp/mnt/digma/usr/ports/net/licq/work/licq-1.2.7' gmake: *** [all] ïÛÉÂËÁ 2 *** Error code 2 Stop in /mnt/digma/usr/ports/net/licq. ** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade35172.0 make ** Fix the problem and try again. Fix: /usr/local/include/getopt.h - file from libgnugetopt-1.2 package. When I deinstall libgnugetopt, compiling licq done well. But I need libgnugetopt (for other packages), and I don't know how to fix this error whitout deinstalling libgnugetopt. May be, change `configure' from licq to detect situation when both /usr/include/unistd.h and /usr/local/include/getopt.h present in system... I think, this error in configure (and, really, in autoconf), because I have an experience with so trouble in the last (with other ports, but I don't remember exactly packages). Note: I use cvsup and portupgrade packages, so I have up to date ports collection and installed software. How-To-Repeat: Upgrade licq from 1.2.6 to 1.2.7 with installed libgnugetopt-1.2
Responsible Changed From-To: freebsd-ports-bugs->dinoex over to maintainer
State Changed From-To: open->feedback I can't reproduce the problem. licq and modules builds 1) without libgnugetopt installed 2) with libgnugetopt installed Please check again.
It seems to me that this is (in part) really a bug in libgnugetopt, or at least an incompatibility between it and the base system. To reproduce without any other ports, install libgnugetopt-1.2 (current as of this writing) on a 5.1-RELEASE system, and do $ cat >foo.cc #include <unistd.h> #include <getopt.h> ^D $ gcc -c -I /usr/local/include foo.cc In file included from foo.cc:2: /usr/local/include/getopt.h:115: declaration of C function `int getopt()' conflicts with /usr/include/unistd.h:377: previous declaration `int getopt(int, char* const*, const char*)' here It would appear that the two headers have conflicting declarations of getopt. The only difference I see is that one has the second argument as `char * const *' while the other has `char * const []'. Apparently they are close enough for C, but not for C++. Note that this also stops the mjpegtools port from building. -- Nate Eldredge neldredge@hmc.edu
State Changed From-To: feedback->closed this only happens with gcc33, a fix has been committed.
I have the same problem with compilation of port nmap-3.46. It ends with error: --------------------------------------------------------- In file included from nbase/nbase.h:256, from nmap.h:109, from main.cc:87: /usr/local/include/getopt.h:115: declaration of C function `int getopt()' conflicts with /usr/include/unistd.h:377: previous declaration `int getopt(int, char* const*, const char*)' here *** Error code 1 Stop in /usr/ports/security/nmap/work/nmap-3.46. *** Error code 1 Stop in /usr/ports/security/nmap. ** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade95723.0 make ----------------------------------------------------------- I also use 5.1-RELEASE system. Please, let me know, when or where I can find patch for that. Thank you ------------------------------------------------------- Pavel Navratil Cisco Certified Security Professional =20 NEXTRA Czech Republic s.r.o. - http://www.nextra.cz V Celnici 10 / CZ - 117 21 Praha 1 / Czech Republic Tel: +420/2/96 355 111 E-mail: pavel.navratil@nextra.cz Contact address: Wolkerova 1331 / CZ - 565 01 Chocen / Czech Republic Tel.: +420/603/279069 See Disclaimer: http://www.nextra.cz/disclaimer/ ------------------------------------------------------- ------------------------------------------------------- Pavel Navratil Cisco Certified Security Professional =20 NEXTRA Czech Republic s.r.o. - http://www.nextra.cz V Celnici 10 / CZ - 117 21 Praha 1 / Czech Republic Tel: +420/2/96 355 111 E-mail: pavel.navratil@nextra.cz Contact address: Wolkerova 1331 / CZ - 565 01 Chocen / Czech Republic Tel.: +420/603/279069 See Disclaimer: http://www.nextra.cz/disclaimer/ -------------------------------------------------------