Re: Syntax Error and I can't find it

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 30 Mar 2010 11:19:56 -0500


Hi Cedric,

To get better error message you can ask the compiler by replacing:

    root [0] #include "auswertung.cpp"

with

   root [0] #include "auswertung.cpp+"

However you would need to turn this file in a proper C++ file (as oppose to using the CINT shortcuts).

Nonetheless, it seems that the problem is with the line:

     Kalib1.Draw( );

where Kalib1 is probably not properly defined.

Cheers,
Philippe.

PS. The recommend way to use you script is:

     root [] .x auswertung.cpp

and the best way to write it is:

  #include "/home/manday/Programs/lib/raupach/praktlib.h"

void auswertung() {
gROOT->SetStyle("Plain");
string baseDir = "/home/manday/Documents/University/Physik Praktikum/Akustik/Cassy/";
gStyle->SetOptFit();

TCanvas gCWegKalib1( "WegKalibration","Kalibration Wegaufnehmer" );

// Linearer Fit Wegaufnehmer
gCWegKalib1.SetGrid();
gCWegKalib1.SetFillColor( kWhite );

   PraktLib *gDatKalib1 = new PraktLib( baseDir + "Kalibrierung.lab","cassy" );
const int gDatKalibLen = gDatKalib1->NumRows();

Double_t* Kalib1R = new Double_t[ gDatKalibLen ]; Double_t* Kalib1S = new Double_t[ gDatKalibLen ]; for( int i = 0; i<gDatKalibLen; i++ ) {

    Kalib1R[ i ]= gDatKalib1->ReadData( i,3 );     Kalib1S[ i ]= gDatKalib1->ReadData( i,4 ); }

Kalib1.Draw( );
}

On 3/30/10 11:07 AM, Cedric Sodhi wrote:
> I'm sorry as I get the feeling that I seem to bombard the mailing list
> with questions which appear trvial at best but CINT is driving me
> in-sane! I don't consider myself a bad programmer, actually I think
> I'm quite good at what I do although my last substancial experience
> with CPP lies a few years behind but that CINThing is getting the last
> iota of patience out of me. I got a deadline for tomorrow and CINT
> stops me at the simplest tasks! Nothing seems to work!
>
> Now, if anyone understand the following error message and can make the
> link to the (few lines long) source code, please let me know, I really
> need the help right now. The #included file in the #included file can
> be found here, but shouldnt be the reason for this (it better be not)
>
> >> If you are interested in trying this out you can find them packed
> here:
> >> http://accms04.physik.rwth-aachen.de/~praktapp/
> <http://accms04.physik.rwth-aachen.de/%7Epraktapp/> -> "Neue ROOT
> Routinen"
> >> Direct link for download:
> >> http://accms04.physik.rwth-aachen.de/~praktapp/root_new/
> <http://accms04.physik.rwth-aachen.de/%7Epraktapp/root_new/>
> >> Author(s) as mentioned on page.
>
> root [0] #include "auswertung.cpp" Converting
> file to csv-file...
> Starting conversion...
> Opening output file: /home/manday/Documents/University/Physik
> Praktikum/Akustik/Cassy/Kalibrierung.lab.out
> Opening input file...
> Checking file type by argument...
> File type: CASSYLab file...
> Looping over file...
> Found 4 y columns...
> Done!
> Reading file /home/manday/Documents/University/Physik
> Praktikum/Akustik/Cassy/Kalibrierung.lab.out...
> Error: Missing one of ',)' expected at or after line 18.
> Error: Unexpected end of file (G__fgetstream_template():2)
> auswertung.cpp:26:
> Error: Missing one of ',;{(' expected at or after line 26.
> Error: Unexpected end of file (G__fgetstream_template():2)
> auswertung.cpp:26:
> Error: Missing one of '{' expected at or after line 26.
> Error: Unexpected end of file (G__fignorestream():3) auswertung.cpp:26:
> *** Interpreter error recovered ***
> root [1]
> ______________________
>
> #include "/home/manday/Programs/lib/raupach/praktlib.h"
>
> gROOT->SetStyle("Plain");
> string baseDir = "/home/manday/Documents/University/Physik
> Praktikum/Akustik/Cassy/";
> gStyle->SetOptFit();
>
> TCanvas gCWegKalib1( "WegKalibration","Kalibration Wegaufnehmer" );
>
> // Linearer Fit Wegaufnehmer
> gCWegKalib1.SetGrid();
> gCWegKalib1.SetFillColor( kWhite );
> PraktLib *gDatKalib1 = new PraktLib( baseDir +
> "Kalibrierung.lab","cassy" );
> const int gDatKalibLen = gDatKalib1->NumRows();
>
> Double_t* Kalib1R = new Double_t[ gDatKalibLen ];
> Double_t* Kalib1S = new Double_t[ gDatKalibLen ];
> for( int i = 0; i<gDatKalibLen; i++ ) {
> Kalib1R[ i ]= gDatKalib1->ReadData( i,3 );
> Kalib1S[ i ]= gDatKalib1->ReadData( i,4 );
> }
>
> Kalib1.Draw( );
>
Received on Tue Mar 30 2010 - 18:20:01 CEST

This archive was generated by hypermail 2.2.0 : Tue Mar 30 2010 - 23:50:02 CEST