Re: [ROOT] Problems with classes using 'ifstream' !!!!!!

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Apr 17 2002 - 18:18:33 MEST


Alexander,

Your makefile is unusable as it is.

I suspect that the source of your problem comes from the fact
that you link with $ROOTSYS/lib/*.so

Use only the libs generated by root-config --glibs

Rene Brun

Alexander Dietz wrote:
> 
> Hello there,
> 
> I am working with ROOT succesfully for a longer time, especially using the
> CINT Dictionary Generator for including own classes into the ROOT system.
> The most works well but now I discovered a problem I cannot solve.
> 
> I am working with ROOT (version 3.02/07) on a computer using an
> Athlon 1.5GHz, Linux version 2.4.17 and C++ compiler g++ (2.95.4).
> 
> In the attachement I have some files: a Makefile to create a program
> 'testroot', a class called 'Test', a class called 'DoNothing' and a
> program 'test.cc'.
> 
> First, I create a program 'testroot' (see Makefile) which includes the
> class 'DoNothing'. This class really does nothing sensefull. It is just as
> example.
> 
> The I start 'testroot' and I load the class 'Test.cc' and execute it
> 
> Root> .L test.cc
> Root> start(a)
> 
> (a can take the values 1 or 2, see 'test.cc)
> 
> In this program the following (should) happens: If a==1 a file is opened
> and closed before a command 'ls' is executed on the shell.
> 
> If a==2 in principle exactly the same (should) happen, the only difference
> is the use of class 'Test' to open and close a file.
> 
> But it did not! If a==1 the program works well and prints out the contents
> of the current directory; if a==2 the program crashes BEFORE printing out
> the content of the current directory. I even can't stop the program then
> by pressing CTRL-C, I have to kill the whole process!
> 
> But when I use 'root' for doing that (the original 'root' without any
> classes included) it also works with a==2.
> 
> So what is wrong here? Why is the command not executed? What can I do to
> use both including own classes and classes working with files?
> 
> I will be happy for any help.
> 
>         A. Dietz
> 
> -----------------------------------
> Alexander Dietz
> Max Planck Institut fuer Kernphysik
> Saupfercheckweg 1
> Postfach 10 39 80
> D-69029 Heidelberg
> 
> Phone: +49-6221-516-259
> 
>   --------------------------------------------------------------------------------
> 
>                  Name: Test.hh
>    Test.hh       Type: Plain Text (TEXT/PLAIN)
>              Encoding: BASE64
> 
>                       Name: DoNothing.hh
>    DoNothing.hh       Type: Plain Text (TEXT/PLAIN)
>                   Encoding: BASE64
> 
>                       Name: DoNothing.cc
>    DoNothing.cc       Type: Plain Text (TEXT/PLAIN)
>                   Encoding: BASE64
> 
>                   Name: Makefile
>    Makefile       Type: Plain Text (TEXT/PLAIN)
>               Encoding: BASE64
> 
>                  Name: Test.cc
>    Test.cc       Type: Plain Text (TEXT/PLAIN)
>              Encoding: BASE64
> 
>                  Name: test.cc
>    test.cc       Type: Plain Text (TEXT/PLAIN)
>              Encoding: BASE64



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:50 MET