This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: help- URGENT build errors while using gcc
- To: jbuck at synopsys dot COM, mrs at windriver dot com
- Subject: Re: help- URGENT build errors while using gcc
- From: "Radhika Shenoy" <meradix at hotmail dot com>
- Date: Tue, 24 Jul 2001 19:34:39 +0530
- Cc: gcc at gcc dot gnu dot org
Thanks Joe,
I did find a workaround for the collision, by using #undef for stl pair and
set, Though i was wondering why the pair definition for stl pair got
included when i had not used the std:: namespace;
That was a doubt which i was hoping that you would help me clear and you did
thanks, are you saying that if i had used the gcc 3.0 compiler the compiler
would not have reported this as an error?(iam using gcc 2.95 here for doing
the builds)
Bye,
Radhika
From: Joe Buck <jbuck@synopsys.COM>
To: mrs@windriver.com (mike stump)
CC: gcc@gcc.gnu.org, meradix@hotmail.com
Subject: Re: help- URGENT build errors while using gcc
Date: Mon, 23 Jul 2001 11:08:30 -0700 (PDT)
> > From: "Radhika Shenoy" <meradix@hotmail.com>
> > To: gcc@gcc.gnu.org
> > Date: Mon, 23 Jul 2001 16:52:21 +0530
>
> > This is because i have a set of old files (created even before the
> > creation of the c++ std libraries) these files have user defined
> > data types named as "set" and "pair". and there is a conflict
> > between these two and the "Stl" set and pair datatypes.
>
> > Is there any way to avoid these errors? i need to use the stl
> > variables too but they are in other files, which are also part of
> > teh same project, the stl set and teh old set are used in two
> > different files. the ordinary CC compilation does not give me these
> > errors!!
>
> > Can you tell me how to tackle this??
>
> Not here. This list is for the discussion of how to create a
> compiler. :-)
>
> You want the, how do I program in C++ list. help-g++@gnu.org would be
> closer to the right list. Also, there is comp.lang.c++ that I think I
> would recommend.
You're perhaps dismissing this guy too quickly, Mike.
The people on the other C++ lists will correctly tell you that this is a
gcc 2.95.x bug, that The STL's "set" and "pair" are supposed to be in the
std namespace. This problem has been fixed in 3.0. With gcc 3.0 or
another conformant C++ compiler, if you don't issue any "using"
directives, then the names for the STL datatypes are std::set and
std::pair.
Just the same, I'm sure people on comp.lang.c++.moderated can show you
awful tricks with the preprocessor to work around this kind of problem.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp