RE: [ROOT] Different behaviour (i.e. Crash) of TString on Linux and Windows

From: Valeri Fine (fine@bnl.gov)
Date: Thu Mar 04 2004 - 21:37:24 MET


OOO,
I think this problem had been discussed and supposed to be fixed.
( I have not found the appropriated ROOT Forum topic though :-(

To see whether it is just try 

     cout<<(const char *)W<<endl;

It should work.


----
Best regards
                   Valeri


> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch] On
> Behalf Of Andreas Zoglauer
> Sent: Thursday, March 04, 2004 2:17 PM
> To: roottalk@pcroot.cern.ch
> Subject: [ROOT] Different behaviour (i.e. Crash) of TString on Linux
and Windows
> 
> 
> Hello,
> 
> The following little program has different behaviour on windows and on
> Linux:
> 
> #include <iostream>
> using namespace std;
> #include "TString.h"
> 
> int main()
> {
>    TString W = "Hello World";
>    cout<<W<<endl;
> 
>    return 0;
> }
> 
> On Linux, the output is of course: Hello, World!
> But on Windows I get a Crash (access violation)!!
> 
> Wenn I replace <iostream> with <Riostream.h> I also crashes on
Windows.
> There is no crash when I replace cout<<W<<endl; with
cout<<W.Data()<<endl;
> 
> Unfortunately I am no Windows expert, so I cannot debug ROOT on
Windows,
> but if I should guess, it might be a problem in ostream& <<operator of
> TString??
> 
> I am using ROOT v4.00/02 win32gdk with Visual C++ 6.0 SP3
> 
> Ciao,
> Andreas Zoglauer



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET