Re: g++ problem

2003-11-07 Thread Christoph P. Kukulies
On Thu, Nov 06, 2003 at 11:28:28AM -0500, Alexander Kabaev wrote:
 On Thu, 6 Nov 2003 16:55:00 +0100 (CET)
 C. Kukulies [EMAIL PROTECTED] wrote:
 
  I tried to compile a virus-scanner for Linux that allows for scanning
  Windoze PCs in a network for all sorts of recent viruses (RPC/DCOM and
  such).
  
  http://www.enyo.de/fw/software/doscan
  
  Compilation fails with the following:
  
  kukuboo2k# gmake
  g++ -g -O2 -Wall -I/usr/local/include -I. -I. -I./lib \
  -MMD -MF src/doscan.d \
  -c -o src/doscan.o src/doscan.cc
  In file included from src/doscan.cc:28:
  /usr/local/include/getopt.h:115: error: declaration of C function `int
  getopt()
 ' conflicts with
  /usr/include/unistd.h:377: error: previous declaration `int
  getopt(int, char*
 const*, const char*)' here
  gmake: *** [src/doscan.o] Error 1
  
  I wonder where /usr/local/include comes from. If I remove that it
  compiles smoothly.
 
 Uhm, from you command line? What _this_ has to do with a compiler?

Clearly. :-)
I should have mentioned that it is not in the Makefile or in variables
defined through /etc/make.conf. (I was using gmake for this). It seems
to be wired somewhere else.

--
Chris Christoph P. U. Kukulies kuku_at_physik.rwth-aachen.de
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: g++ problem

2003-11-07 Thread Kris Kennaway
On Fri, Nov 07, 2003 at 09:19:53AM +0100, Christoph P. Kukulies wrote:

 Clearly. :-)
 I should have mentioned that it is not in the Makefile or in variables
 defined through /etc/make.conf. (I was using gmake for this). It seems
 to be wired somewhere else.

There just aren't many possibilities here:

1) Environment

2) The makefile or something included by the makefile.

g++ doesn't come up with the command line it is executed with; gmake
executes g++ with the arguments specified in the makefile.

Kris


pgp0.pgp
Description: PGP signature


Re: g++ problem

2003-11-06 Thread Alexander Kabaev
On Thu, 6 Nov 2003 16:55:00 +0100 (CET)
C. Kukulies [EMAIL PROTECTED] wrote:

 I tried to compile a virus-scanner for Linux that allows for scanning
 Windoze PCs in a network for all sorts of recent viruses (RPC/DCOM and
 such).
 
 http://www.enyo.de/fw/software/doscan
 
 Compilation fails with the following:
 
 kukuboo2k# gmake
 g++ -g -O2 -Wall -I/usr/local/include -I. -I. -I./lib \
 -MMD -MF src/doscan.d \
 -c -o src/doscan.o src/doscan.cc
 In file included from src/doscan.cc:28:
 /usr/local/include/getopt.h:115: error: declaration of C function `int
 getopt()
' conflicts with
 /usr/include/unistd.h:377: error: previous declaration `int
 getopt(int, char*
const*, const char*)' here
 gmake: *** [src/doscan.o] Error 1
 
 I wonder where /usr/local/include comes from. If I remove that it
 compiles smoothly.

Uhm, from you command line? What _this_ has to do with a compiler?

-- 
Alexander Kabaev
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: g++ problem

2003-11-06 Thread Marius Strobl
On Thu, Nov 06, 2003 at 11:28:28AM -0500, Alexander Kabaev wrote:
 On Thu, 6 Nov 2003 16:55:00 +0100 (CET)
 C. Kukulies [EMAIL PROTECTED] wrote:
 
  I tried to compile a virus-scanner for Linux that allows for scanning
  Windoze PCs in a network for all sorts of recent viruses (RPC/DCOM and
  such).
  
  http://www.enyo.de/fw/software/doscan
  
  Compilation fails with the following:
  
  kukuboo2k# gmake
  g++ -g -O2 -Wall -I/usr/local/include -I. -I. -I./lib \
  -MMD -MF src/doscan.d \
  -c -o src/doscan.o src/doscan.cc
  In file included from src/doscan.cc:28:
  /usr/local/include/getopt.h:115: error: declaration of C function `int
  getopt()
 ' conflicts with
  /usr/include/unistd.h:377: error: previous declaration `int
  getopt(int, char*
 const*, const char*)' here
  gmake: *** [src/doscan.o] Error 1
  
  I wonder where /usr/local/include comes from. If I remove that it
  compiles smoothly.
 
 Uhm, from you command line? What _this_ has to do with a compiler?
 

This happens with g++ 3.x when the devel/libgnugetopt port is installed
and both its getopt.h and the base unistd.h are included. There are
several ports that have workarounds for this issue.
I have a patch for devel/libgnugetopt at
ftp://ftp.zeist.de/pub/patches/devel_libgnugetopt.diff
that should fix this issue by updating to the latest sources.
In my opinion the right thing to do is however to also include
getopt_long_only() in libc and not only getopt_long() so one can get
rid of the devel/libgnugetopt port. I have a patch for this at
ftp://ftp.zeist.de/pub/patches/src_getopt_long_only.diff
When I have time I'll continue testing of both and eventually submit
PRs.

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: g++ problem

2003-11-06 Thread Alexander Kabaev
On Thu, 6 Nov 2003 17:44:59 +0100
Marius Strobl [EMAIL PROTECTED] wrote:

 This happens with g++ 3.x ...
This will happen with g++ 3.x, 2.x, 1.x and future 4.x too. I.e. the
GCC is not at fault and the subject of the original message is
misleading.

-- 
Alexander Kabaev
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: g++ problem

2003-11-06 Thread Harti Brandt
On Thu, 6 Nov 2003, Marius Strobl wrote:

MSOn Thu, Nov 06, 2003 at 11:28:28AM -0500, Alexander Kabaev wrote:
MS On Thu, 6 Nov 2003 16:55:00 +0100 (CET)
MS C. Kukulies [EMAIL PROTECTED] wrote:
MS
MS  I tried to compile a virus-scanner for Linux that allows for scanning
MS  Windoze PCs in a network for all sorts of recent viruses (RPC/DCOM and
MS  such).
MS 
MS  http://www.enyo.de/fw/software/doscan
MS 
MS  Compilation fails with the following:
MS 
MS  kukuboo2k# gmake
MS  g++ -g -O2 -Wall -I/usr/local/include -I. -I. -I./lib \
MS  -MMD -MF src/doscan.d \
MS  -c -o src/doscan.o src/doscan.cc
MS  In file included from src/doscan.cc:28:
MS  /usr/local/include/getopt.h:115: error: declaration of C function `int
MS  getopt()
MS ' conflicts with
MS  /usr/include/unistd.h:377: error: previous declaration `int
MS  getopt(int, char*
MS const*, const char*)' here
MS  gmake: *** [src/doscan.o] Error 1
MS 
MS  I wonder where /usr/local/include comes from. If I remove that it
MS  compiles smoothly.
MS
MS Uhm, from you command line? What _this_ has to do with a compiler?
MS
MS
MSThis happens with g++ 3.x when the devel/libgnugetopt port is installed
MSand both its getopt.h and the base unistd.h are included. There are
MSseveral ports that have workarounds for this issue.
MSI have a patch for devel/libgnugetopt at
MSftp://ftp.zeist.de/pub/patches/devel_libgnugetopt.diff
MSthat should fix this issue by updating to the latest sources.
MSIn my opinion the right thing to do is however to also include
MSgetopt_long_only() in libc and not only getopt_long() so one can get
MSrid of the devel/libgnugetopt port. I have a patch for this at
MSftp://ftp.zeist.de/pub/patches/src_getopt_long_only.diff
MSWhen I have time I'll continue testing of both and eventually submit
MSPRs.

getopt.h is broken. It should not define a Posix reserved name or the
application should not use any of the interfaces in unistd.h. You cannot
have both.

harti
-- 
harti brandt,
http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private
[EMAIL PROTECTED], [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: g++ problem

2003-11-06 Thread Marius Strobl
On Thu, Nov 06, 2003 at 11:51:12AM -0500, Alexander Kabaev wrote:
 On Thu, 6 Nov 2003 17:44:59 +0100
 Marius Strobl [EMAIL PROTECTED] wrote:
 
  This happens with g++ 3.x ...
 This will happen with g++ 3.x, 2.x, 1.x and future 4.x too. I.e. the
 GCC is not at fault and the subject of the original message is
 misleading.
 

It's at least not fatal with g++ 2.95.4 on 4-stable, that's what I
meant. But yes, GCC is not at fault.

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]