Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SGI STL 3.11

2 views
Skip to first unread message

Mike Burroughs

unread,
Nov 6, 1998, 3:00:00 AM11/6/98
to
Has anybody tried using the SGI version 3.11 of the STL? It can't be any
worse than Microsoft's implementation, can it?

Mike Burroughs
Chief Architect
NSI Software, Inc.


Frederick D

unread,
Nov 9, 1998, 3:00:00 AM11/9/98
to
>Has anybody tried using the SGI version 3.11 of the STL? It can't be any
>worse than Microsoft's implementation, can it?
STL that comes with VC++ is implemented by Dinkum, not MS themselves. And I
don't think it's that bad. IMHO, it's quite a good one.

--
Frederick J. Dunhill
To reply via e-mail, replace coldmail.org with hotmail.com

"How about an anti spammers campaign?"


Jonas Utterström

unread,
Nov 9, 1998, 3:00:00 AM11/9/98
to
Hi,

Mike Burroughs wrote:
>
> Has anybody tried using the SGI version 3.11 of the STL? It can't be any
> worse than Microsoft's implementation, can it?
>

Yes I have. It works so far for me with VC6. The 3.11 STL contains a lot
of enhancements, such as hash_map and rope.

/Jonas U

Frederick D

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to
I did try, though, and it doesn't work with VC++ 6.0 (choking the compiler
with 100 or so error messages). How do you make it work with VC++ 6.0? Did
you put it in a separate directory, of you just replace your header files
with SGI's? I put it in separate directory and add the directory to the
include path, above the C:\Program Files\....\VC98\include, So I know that
the SGI's headers will always be searched first. But then...

--
Frederick J. Dunhill
To reply via e-mail, replace coldmail.org with hotmail.com

"Before order there is chaos. Before happiness there is sorrow. Before life
there is death. Like a phoenix bird it vanishes, like a phoenix bird it
resurrects."


Mike Burroughs wrote in message ...


>Has anybody tried using the SGI version 3.11 of the STL? It can't be any
>worse than Microsoft's implementation, can it?
>

Jonas Utterström

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to

Frederick D wrote:
>
> I did try, though, and it doesn't work with VC++ 6.0 (choking the compiler
> with 100 or so error messages). How do you make it work with VC++ 6.0? Did
> you put it in a separate directory, of you just replace your header files
> with SGI's? I put it in separate directory and add the directory to the
> include path, above the C:\Program Files\....\VC98\include, So I know that
> the SGI's headers will always be searched first. But then...
>

I have SGI STL in a separate directory and added that directory first in
the include path. I have only used these include files so far: vector,
algorithm, function, set and hash_map. Could you please post some of the
errors you get?

/Jonas U

Jonathan H Lundquist

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to
I've been working on a port from SGI's to meet my own needs. The container
classes are complete, and it's at
http://www.mindspring.com/~fluxsmith/Programming/library.html
It's specifically for MSVC 6.0, which requires many changes to otherwise
good code because of internal compiler errors.

Frederick D <fred_d...@coldmail.org> wrote in message
news:O##jvCgD#GA....@uppssnewspub04.moswest.msn.net...


>I did try, though, and it doesn't work with VC++ 6.0 (choking the compiler
>with 100 or so error messages). How do you make it work with VC++ 6.0? Did
>you put it in a separate directory, of you just replace your header files
>with SGI's? I put it in separate directory and add the directory to the
>include path, above the C:\Program Files\....\VC98\include, So I know that
>the SGI's headers will always be searched first. But then...
>

Frederick D

unread,
Nov 13, 1998, 3:00:00 AM11/13/98
to
>I have SGI STL in a separate directory and added that directory first in
>the include path. I have only used these include files so far: vector,
>algorithm, function, set and hash_map. Could you please post some of the
>errors you get?

Hmm, I think that explains it. Later observation showed that SGI's
*compiles* with VC 6.0 *provided* that you don't use the non-STL headers
that
comes with SGI's STL, like <bitset> or <string>. If you stick with STL
headers, it compiles fine. The following headers compile without problems

<algorithm> <deque> <functional> <hash_map> <hash_set> <iterator>
<list> <map> <memory> <numeric> <queue> <rope> <set>
<slist>
<stack> <utility> <vector>

And this is some of the error messages I got by including <string>:

c:\vc\include\sgi\stl_string_fwd.h(38) : error C2065: 'alloc' : undeclared
identifier
c:\vc\include\sgi\stl_string_fwd.h(38) : error C2974: 'basic_string' :
invalid template argument for '_Alloc', type expected
c:\vc\include\sgi\stl_string_fwd.h(36) : see declaration of
'basic_string'
c:\vc\include\sgi\stl_string_fwd.h(39) : error C2974: 'basic_string' :
invalid template argument for '_Alloc', type expected
c:\vc\include\sgi\stl_string_fwd.h(36) : see declaration of
'basic_string'

Defining this:
#define __STL_USE_STD_ALLOCATORS

reduce the errors, but I must stop there since VC++ 6.0 just can't compile
the following line:

=> template <class _Tp1> allocator(const allocator<_Tp1>&) __STL_NOTHROW {}

using template keyword for members, that is. Take a look at stl_alloc.h


But then, something still bothers me, though. Don't you use <string>, or
stream whatsoever? Because merely the inclusion of <string> or stream
library again stall the compiler (this is after I rename SGI's string and
bitset, again using VC string and bitset)... <sigh>

Guess I'll go to

http://www.mindspring.com/~fluxsmith/Programming/library.html

and take a close look at Jonathan's work.

Jonas Utterström

unread,
Nov 13, 1998, 3:00:00 AM11/13/98
to

Frederick D wrote:
>
> But then, something still bothers me, though. Don't you use <string>, or
> stream whatsoever? Because merely the inclusion of <string> or stream
> library again stall the compiler (this is after I rename SGI's string and
> bitset, again using VC string and bitset)... <sigh>

It seems that VC6 has serious trouble with the <string> include file. I
have no code that uses the string class so I guess that I'm lucky. How
about removing the SGI string include files and use the VC6 variants? (I
haven't tried it myself)

/Jonas U

Frederick D

unread,
Nov 15, 1998, 3:00:00 AM11/15/98
to
>It seems that VC6 has serious trouble with the <string> include file. I
>have no code that uses the string class so I guess that I'm lucky. How
>about removing the SGI string include files and use the VC6 variants? (I
>haven't tried it myself)
I have, by renaming SGI <string>, but then, using VC 6.0 <string> again
yielded tens of errors. I'm still figuring this out.

Asger K. Alstrup Nielsen

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
"Frederick D" <fred_d...@coldmail.org> writes:

>STL that comes with VC++ is implemented by Dinkum, not MS themselves. And I
>don't think it's that bad. IMHO, it's quite a good one.

Did anybody get the shipped STL to work when the -Za flag is used?
I want to disable the "language extensions", that ruin the correct
for-scoping rules.

I want to write code like: [warning: untested]

---
#include <string>

using namespace std;

int main() {
string t = "First we do something: ";
for (int i=1; i <= 9: ++i) {
t = t + ".";
}
t = t + " and now something else: ";
for (int i=9; i > 0; --i) {
t = t + "!";
}
return t.size();
}
---

When compiled without the -Za flag, I get a "redefinition of i" error,
which clearly is a violation of the C++ standard.

So, I try with the -Za enable, but then the compiler fails with hundreds
of errors.

I tried to use the SGL STL 3.11 instead of the included STL, but experienced
the same problem with #include <string> as already discussed.

Does anybody know a way to enable the correct for-scoping without breaking
the STL? Anything, including the use of an alternative STL implementation,
is a solution to me, as long as it is portable to any reasonably compliant
C++ compiler with a reasonably compliant STL library.

Thanks,

Asger Alstrup Nielsen

Robert C. Paulsen, Jr.

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
try the following...

> #include <string>
>
> using namespace std;
>

#pragma warning( disable:4127)
#define for if(0);else for

> int main() {
> string t = "First we do something: ";
> for (int i=1; i <= 9: ++i) {
> t = t + ".";
> }
> t = t + " and now something else: ";
> for (int i=9; i > 0; --i) {
> t = t + "!";
> }
> return t.size();
> }
--

Robert Paulsen http://paulsen.home.texas.net
If my return address contains "ZAP." please remove it. Sorry for the
inconvenience but the unsolicited email is getting out of control.

0 new messages