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

From: Valeri Fine (fine@bnl.gov)
Date: Fri Mar 05 2004 - 17:24:36 MET


Hello Andreas Zoglauer,

I think the essential point here is 

> 3. MSVCIRT.LIB does not appear anywhere in the settings so no nee d to
> replace it

  The problem is the lib does appear through MS include files and it
depends of the compilation options and the compiler versions:


Please, look up the MS header files:

---------- USEOLDIO.H
#pragma deprecated(_OLD_IOSTREAMS_ARE_DEPRECATED)
#pragma comment(lib,"msvcirtd")
#pragma comment(lib,"msvcirt")
#pragma comment(lib,"libcimtd")
#pragma comment(lib,"libcimt")
#pragma comment(lib,"libcid")
#pragma comment(lib,"libci")


and 

---------- USE_ANSI.H
*use_ansi.h - pragmas for ANSI Standard C++ libraries
#pragma once
#pragma comment(lib,"msvcprtd")
#pragma comment(lib,"msvcprt")
#pragma comment(lib,"libcpmtd")
#pragma comment(lib,"libcpmt")
#pragma comment(lib,"libcpd")
#pragma comment(lib,"libcp")
 

To check your environmwent I would suggest yiou to try build the ROOT
test suite from the %ROOTSYS%\test subdirectory.

Just "cd" there and say:
 Nmake -f Makefile.win32. 
It should build a bunch of the stand-along ROOT-based executables (like
yours).
Please try to invoke all (or some) of them and send me the make utility
log as well as executable output, That helps us to make things clear.

   Than you,
> 
> 
> Hello Valeri,
> 
> 
> I removed all hints of the old root and all PATH, etc. variables
needed
> by root
> I upgraded to Visual C++ 6 service pack 5.
> I installed your Qt Root.
> I created a new project.
> 
> 
> In order to make the program compile and run, I had to add some paths:
> 
> In VC++ -> Tools -> Options -> Directories -> Include files:
>    c:\programme\bnl\root\include
> 
> In VC++ -> Tools -> Options -> Directories -> Library files:
>    c:\programme\bnl\root\lib
> 
> In VC++ -> Project -> Settings -> Link -> Object modules:
>    libCore.dll
> 
> In Windows XP SP1 I have to add the PATH variable:
>    c:\Programme\bnl\root\bin
> (Otherwise libCORE.dll can not be found, when the program tries to
launch)
> 
> Comparing this with the instruction from the
> http://root.cern.ch/root/Version310.html then
> 
> 1. the \GX switch was already on
> 2. using Riostream.h did not solve the problem
> 3. MSVCIRT.LIB does not appear anywhere in the settings so no nee d to
> replace it
> 4. I did not add any of the libraries, because QTRoot is "one-click"
> install?
> 
> 
> 
> But still my little programm crashes:
> 
> #include <iostream>
> using namespace std;
> #include "TString.h"
> 
> int main()
> {
>     TString W = "Hello World";
>     cout<<W<<endl;             // <- Crash with access violation
> 
>     return 0;
> }
> 
> And CINT does not print the following line:
> 
> TString W = "Hello World";
> cout<<W<<endl;               // no output
> 
> cout<<(const char *)W<<endl; // output ok
> Hello World
> 
> 
> So, can you give me any hint where I might have a mess of different
VC++
> dlls???
> 
> 
> Any help is appreciated
> 
> Andreas Zoglauer
> 
> 
> 
> 
> Valeri Fine wrote:
> > Hello Andreas.  Can you try to install the version
> >>From http://root.bnl.gov to see whether your problem still persists.
> > It is one click installation.
> > I guess you have some mess (mix) of the different VC++ dlls.
> >
> > ----
> > Best regards
> >                    Valeri
> >
> 
> --
> 
> Andreas Zoglauer
> 
> MPI fuer extraterrestrische Physik         Phone:    +49/89-30000-3848
> Postfach 1312                              Fax:      +49/89-30000-3569
> 85741 Garching, Germany                    Email:    zog@mpe.mpg.de
> 
> 
> 
> 
> 



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