public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: help- URGENT build errors while using gcc
@ 2001-07-23 10:03 mike stump
  2001-07-23 11:09 ` Joe Buck
  0 siblings, 1 reply; 5+ messages in thread
From: mike stump @ 2001-07-23 10:03 UTC (permalink / raw)
  To: gcc, meradix

> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help- URGENT build errors while using gcc
  2001-07-23 10:03 help- URGENT build errors while using gcc mike stump
@ 2001-07-23 11:09 ` Joe Buck
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Buck @ 2001-07-23 11:09 UTC (permalink / raw)
  To: mike stump; +Cc: gcc, meradix

> > 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.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help- URGENT build errors while using gcc
  2001-07-24  7:04 Radhika Shenoy
@ 2001-07-24  8:40 ` Joe Buck
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Buck @ 2001-07-24  8:40 UTC (permalink / raw)
  To: Radhika Shenoy; +Cc: jbuck, mrs, gcc

> 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;

Because, in 2.95.2 the standard library is not in std, but is in the
global 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?

In 3.0, the standard library *is* in the global namespace.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help- URGENT build errors while using gcc
@ 2001-07-24  7:04 Radhika Shenoy
  2001-07-24  8:40 ` Joe Buck
  0 siblings, 1 reply; 5+ messages in thread
From: Radhika Shenoy @ 2001-07-24  7:04 UTC (permalink / raw)
  To: jbuck, mrs; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* help- URGENT build errors while using gcc
@ 2001-07-23  4:22 Radhika Shenoy
  0 siblings, 0 replies; 5+ messages in thread
From: Radhika Shenoy @ 2001-07-23  4:22 UTC (permalink / raw)
  To: gcc

Hi,

I am getting errors of this type =>

/vobs/snps/syn/uisyn/schem/gen/gen_int_struct.h:53: `typedef struct 
pair_struct * pair'
redeclared as different kind of symbol
/depot/gcc-2.95.2-OS7/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/../../../../include/g++-3/stl_pair.h:37:
previous declaration of `template <class _T1, class _T2> struct 
pair<_T1,_T2>'

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??

-Thanks
Radhika


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-07-24  8:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-23 10:03 help- URGENT build errors while using gcc mike stump
2001-07-23 11:09 ` Joe Buck
  -- strict thread matches above, loose matches on Subject: below --
2001-07-24  7:04 Radhika Shenoy
2001-07-24  8:40 ` Joe Buck
2001-07-23  4:22 Radhika Shenoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).