[SunHELP] A problem about stream in Solaris8

sunhelp at sunhelp.org sunhelp at sunhelp.org
Sat Jun 9 23:29:45 CDT 2001


Hi, all

I have a problem when using stream in multithread environment.
The code lists below.

//Source file name is streamtest.cpp
#include <strstream>
using namespace std;

int main()
{
    strstream a_stream;
    return 0;
}

compile and link (using workshop5.0, in Solaris8) with the following
command:
CC -o streantest streamtest.cpp -mt

When I run the program in Solaris8, it blocks in the strstream's
constructor.

Remove the '-mt' option, it runs well.
But, compiling and running it in Solaris 2.6, it works well.

Why?
Please help me.

thanks.





More information about the SunHELP mailing list