Re: NGPT + C++ = ?
Harro Verkouter <[email protected]>
| Newsgroups | gmane.linux.ngpt.devel |
|---|---|
| Organization | JIVE |
| Message-ID | <[email protected]> |
Hi,
ok... sounds plausible... better still: it definitely seems to be the
reason :) I've tried to reproduce now by hand:
<<< inet.cc >>>
#include <iostream.h>
#include <netinet/in.h>
int main()
{
return 0;
}
<<< /inet.cc >>>
And then try to compile as this:
[master]:Okay->g++ -nostdinc -fPIC -g -Wall -fexceptions
-ftemplate-depth-25 -D_REENTRANT -DBUILDTIME="Tuesday 13 August
2002/09:22:09" -D_POSIX_PTHREAD_SEMANTICS
-I/usr/lib/gcc-lib/i486-suse-linux/2.95.3/include -I/usr/include
-I/usr/include/g++ -I/jop200_0/verkout/pci/src/libs -o inet inet.cc
In file included from /usr/include/netinet/in.h:250,
from inet.cc:2:
/usr/include/bits/in.h:69: ANSI C++ forbids data member `ip_opts' with
same name as enclosing class
If I compile it as:
[master]:Okay->g++ -fPIC -g -Wall -fexceptions -ftemplate-depth-25
-D_REENTRANT -DBUILDTIME="Tuesday 13 August 2002/09:22:09"
-D_POSIX_PTHREAD_SEMANTICS
-I/usr/lib/gcc-lib/i486-suse-linux/2.95.3/include -I/usr/include
-I/usr/include/g++ -I/jop200_0/verkout/pci/src/libs -o inet inet.cc
[master]:Okay->
it works like a charm (notice: just removed the -nostdinc option)
Another, far from desirable solution (what we did, at one point) was to
hack the system include file bits/in.h and change it from an anonymous
struct definition into a typedef and then it also compiles just fine
(with the -nostdinc option)
Thanks for the explanation!
Cheers,
Harro
Arend-jan Wytzes wrote:
>
> Hi,
>
> The problem you're seeing is probably because you disabled the default
> include paths, and then enabled those by hand.
>
> The compiler does not warn about errors in header files that are located in
> the default include path, probably because you don't want to be bothered
> with those as a developer. So warnings for code in the system header files
> are ignored because those files are in the default path.
>
> Grtz,
>
> aj
--
Groeten,
Harro Verkouter Joint Institute for VLBI in Europe
[email protected] Radiosterrenwacht Dwingeloo
Postbus 2
tel.: (+31)(0)521-596516 7990 AA DWINGELOO, the Netherlands
fax.: (+31)(0)521-597332
------------------------------------------------------------------
They laughed at Einstein. They laughed at the Wright Brothers.
But they also laughed at Bozo the Clown.
-- Carl Sagan
------------------------------------------------------------------