Subject: problem with SGI STL (was: Newbie getting started...)
From: [email-masked] (Kimball Thurston)

24 Sep 1998 13:27:53 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Ben Parrish <[email-masked]>, [email-masked]

Ben Parrish wrote:

> Well, everything looks installed okay, but when I compile this :
>
> #include <string>
> main() {
>    string test;
> }
>
> ...I get pages full of errors talking about "multiple definitions" of basic_string-related stuff.
>
> I apologize in advance for the low-level nature of this request.  I'll catch on fast.  :)
>

No worries. I've been trying to figure out why the SGI STL (now shipped with egcs, I guess) doesn't
compile <string>, _even under the SGI compiler_!!!! I've tried egcs, SGI CC 7.1.x under Irix, MS VC++
5.0. All to no avail.

I traced it back to a circular dependency between <string>, <stdexcept>, and <stl_string_fwd.h>:
1. <string> includes <stdexcept> as the second include file so it can throw length, etc. errors...
2. <stdexcept> includes <stl_string_fwd.h> (oh, and relies on class string being defined, BTW)
3. <stl_string_fwd.h> relies on char_traits, basic_string, et al. being defined for some typedefs....
But wait! I'm in the middle of the setup includes for <string>, so I haven't defined it yet!!! ACK.

If anyone knows a workaround to this, or how the heck SGI gets <string> to compile, please let me
(and I guess others) know.... we posted a message to SGI, but haven't heard anything...

thanks,

--
Kimball
mailto:[email-masked]
---------------
"Time has little to do with infinity and jelly doughnuts." - Unknown

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".