Conflict between VC 7 STL and SGI STL - how to resolve 
Author Message
 Conflict between VC 7 STL and SGI STL - how to resolve

I am using a recent build of Microsoft VC 7.0 beta.  I'm STRUGGLING
big time trying to
use the SGI implementation of STL instead of the default Microsoft STL
included with VC.

Can anyone tell me the proper way to set things up so that there are
no conflicts between the SGI STL and MS's STL?

I am getting all sorts of compile/link errors that seem to suggest
that the the presence of the SGI STL include files is causing
compile/link errors with Microsoft's ATL (which I'm using) and other
things as well.

In particular, when doing this:
#include <hash_map>
#include <atlcoll.h>
I get hundreds of the following error message:
  Error C2027: use of undefined type 'ATL::CVarTypeInfo'

If I remove the include of atlcoll.h (which I need for other things)
then it compiles and links fine.  Likewise if I remove the include of
hash_map and its related code and keep the atlcoll.h, then it works
fine too.

Here's what I've done to set up the SGI STL - perhaps this is wrong?
1) downloaded the SGI STL files to c:\stl
2) changed my VC compiler options to have c:\stl as the first
directory it looks in for include files.

But this doesn't seem right as I'm getting all sorts of conflicts.  I
tried both with defining __STL_NO_NAMESPACES and not defining that.
Defining it at first seemed to resolve some compile issues, but then
later
when I needed the atlcoll.h and hash_map together I was back at
getting the C2027 error mentioned above.

It seems as though some of the ATL classes use some of the same
template/class names as used by the STL and that may be where the
problem is coming from.  I even tried changing the STL via
stl_config.h to define a unique namespace for the SGI STL, but that
didn't help at all.

I would be VERY greatful and appreciative of any help or pointers on
how to override the MS STL with the SGI STL without causing all sorts
of these conflicts.  Please help!  Thank you!!

RH



Sat, 03 Jul 2004 00:01:48 GMT  
 Conflict between VC 7 STL and SGI STL - how to resolve
Go to www.stlport.org and get the latest release of STLPort.  It includes
instructions on replacing the MSVC standard library's STL. (STLPort is based
on SGI STL)
-cd


Quote:
> I am using a recent build of Microsoft VC 7.0 beta.  I'm STRUGGLING
> big time trying to
> use the SGI implementation of STL instead of the default Microsoft STL
> included with VC.

> Can anyone tell me the proper way to set things up so that there are
> no conflicts between the SGI STL and MS's STL?

> I am getting all sorts of compile/link errors that seem to suggest
> that the the presence of the SGI STL include files is causing
> compile/link errors with Microsoft's ATL (which I'm using) and other
> things as well.

> In particular, when doing this:
> #include <hash_map>
> #include <atlcoll.h>
> I get hundreds of the following error message:
>   Error C2027: use of undefined type 'ATL::CVarTypeInfo'

> If I remove the include of atlcoll.h (which I need for other things)
> then it compiles and links fine.  Likewise if I remove the include of
> hash_map and its related code and keep the atlcoll.h, then it works
> fine too.

> Here's what I've done to set up the SGI STL - perhaps this is wrong?
> 1) downloaded the SGI STL files to c:\stl
> 2) changed my VC compiler options to have c:\stl as the first
> directory it looks in for include files.

> But this doesn't seem right as I'm getting all sorts of conflicts.  I
> tried both with defining __STL_NO_NAMESPACES and not defining that.
> Defining it at first seemed to resolve some compile issues, but then
> later
> when I needed the atlcoll.h and hash_map together I was back at
> getting the C2027 error mentioned above.

> It seems as though some of the ATL classes use some of the same
> template/class names as used by the STL and that may be where the
> problem is coming from.  I even tried changing the STL via
> stl_config.h to define a unique namespace for the SGI STL, but that
> didn't help at all.

> I would be VERY greatful and appreciative of any help or pointers on
> how to override the MS STL with the SGI STL without causing all sorts
> of these conflicts.  Please help!  Thank you!!

> RH



Sat, 03 Jul 2004 01:37:55 GMT  
 Conflict between VC 7 STL and SGI STL - how to resolve
Thanks for the suggestion.  I started using STLPort and fell in love
with it!  It worked the first time, with no namespace clashing issues
like I had with the SGI STL.

However, and this is a big one, I am unable to use STLPort because of
a bug with their operator< comparision which won't allow my
lower_bound to compile (or so I've been told it is a bug by someone in
a forum there).  In summary, I need to pass in a different object time
as the comarision object and the compiler is complaining because it is
not the same object type as defined for the vector.  For details on
this issue see my recent post to this group with the subject "Trouble
using lower_bound, only with STLPort STL".

So, unfortunately, this brings me back to my original question - how
can I set up the SGI STL properly to work without clashes?  Under VC 7
there are clashes all over the place at compile time if atlcoll.h is
included.  This problem did not occur under VC 6.

Ideas?  Thanks!

Quote:

> Go to www.stlport.org and get the latest release of STLPort.  It includes
> instructions on replacing the MSVC standard library's STL. (STLPort is based
> on SGI STL)
> -cd



> > I am using a recent build of Microsoft VC 7.0 beta.  I'm STRUGGLING
> > big time trying to
> > use the SGI implementation of STL instead of the default Microsoft STL
> > included with VC.

> > Can anyone tell me the proper way to set things up so that there are
> > no conflicts between the SGI STL and MS's STL?

> > I am getting all sorts of compile/link errors that seem to suggest
> > that the the presence of the SGI STL include files is causing
> > compile/link errors with Microsoft's ATL (which I'm using) and other
> > things as well.

> > In particular, when doing this:
> > #include <hash_map>
> > #include <atlcoll.h>
> > I get hundreds of the following error message:
> >   Error C2027: use of undefined type 'ATL::CVarTypeInfo'

> > If I remove the include of atlcoll.h (which I need for other things)
> > then it compiles and links fine.  Likewise if I remove the include of
> > hash_map and its related code and keep the atlcoll.h, then it works
> > fine too.

> > Here's what I've done to set up the SGI STL - perhaps this is wrong?
> > 1) downloaded the SGI STL files to c:\stl
> > 2) changed my VC compiler options to have c:\stl as the first
> > directory it looks in for include files.

> > But this doesn't seem right as I'm getting all sorts of conflicts.  I
> > tried both with defining __STL_NO_NAMESPACES and not defining that.
> > Defining it at first seemed to resolve some compile issues, but then
> > later
> > when I needed the atlcoll.h and hash_map together I was back at
> > getting the C2027 error mentioned above.

> > It seems as though some of the ATL classes use some of the same
> > template/class names as used by the STL and that may be where the
> > problem is coming from.  I even tried changing the STL via
> > stl_config.h to define a unique namespace for the SGI STL, but that
> > didn't help at all.

> > I would be VERY greatful and appreciative of any help or pointers on
> > how to override the MS STL with the SGI STL without causing all sorts
> > of these conflicts.  Please help!  Thank you!!

> > RH



Sun, 04 Jul 2004 01:14:22 GMT  
 Conflict between VC 7 STL and SGI STL - how to resolve

Quote:

> Thanks for the suggestion.  I started using STLPort and fell in love
> with it!  It worked the first time, with no namespace clashing issues
> like I had with the SGI STL.

> However, and this is a big one, I am unable to use STLPort because of
> a bug with their operator< comparision which won't allow my
> lower_bound to compile (or so I've been told it is a bug by someone in
> a forum there).  [...]

> Ideas?  Thanks!
> [...]

  STLport is open source. Just dig into it, fix it,
  and send the fix to Boris. Then you have your stuff
  working, and as with the next release everyone else
  has it, too.
  (I lack the time to search for and read through the
  other thread as you suggested. Sorry.)

  Schobi

--

I'm hschober at gmx dot de



Tue, 06 Jul 2004 03:50:31 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ATL conflict between VC 7 STL and SGI STL - how to resolve

2. Conflict between VC 7 STL and SGI STL - how to resolve?

3. Porting code from SGI STL to MSVC STL

4. SGI-STL or STL of VC++

5. VC++ STL v/s SGI STL Performance ???

6. VC 5.0 and SGI STL

7. SGI STL w/vc 5.0?

8. sgi STL & vc++ 6.0

9. VC 6 and SGI STL 3.11

10. SGI STL usable with VC 4.0

11. Free C++ SIG:Austern,SGI STL;Feb 8,Sat

12. VC++ and STL (SGI Implementation)

 

 
Powered by phpBB® Forum Software