A simple class used with cint

Hi Rooters,
I’m trying to use a script compiling it with root 5.18, downloaded binaries from root page, on Macosx 10.5.1.

I’m trying to open two simple root files and doing some job on them.
At a certain point I decided to simplify my code using a simple class.
Now I get so many and strange errors that I cannot understand.

for example:

root [2] .L Compare_Radon_2.C++
Info in <TUnixSystem::ACLiC>: creating shared library /Users/..my path..././Compare_Radon_2_C.so
Error: Missing closing brace for the block opened around line 9.
Error: Unexpected end of file (G__exec_statement()) /var/tmp/tmp.1.pu1wgb_cint.cxx:2:
Error: Missing one of ';,(' expected at or after line 2.
Error: Unexpected end of file (G__fgetname():2) /var/tmp/tmp.1.pu1wgb_cint.cxx:2:
Error: Missing one of '*&,;=():}' expected at or after line 2.
Error: Unexpected end of file (G__fgetvarname():2) /var/tmp/tmp.1.pu1wgb_cint.cxx:2:
Error: Missing one of ',;=():' expected at or after line 2.
Error: Unexpected end of file (G__fgetstream():2) /var/tmp/tmp.1.pu1wgb_cint.cxx:2:
Syntax Error:  Maybe missing ';' /var/tmp/tmp.1.pu1wgb_cint.cxx:2:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing /Users/..my path..././tmp_10_qRUWwu.cxx /Users/paolorisso/..my path..././tmp_10_qRUWwu.h !!!
Error: rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
Info in <ACLiC>: Invoking compiler to check macro's validity
/Users/..my path..././Compare_Radon_2.h:72: error: ISO C++ forbids declaration of ‘vector’ with no type
/Users/..my path..././Compare_Radon_2.h:72: error: expected ‘;’ before ‘<’ token
/Users/..my path..././Compare_Radon_2.h:73: error: ISO C++ forbids declaration of ‘vector’ with no type
/Users/..my path..././Compare_Radon_2.h:73: error: expected ‘;’ before ‘<’ token

and so on…
Can you help me, I’m sure that probaby I do some mess in declaring/using a class.
Compare_Radon_2.h (5.87 KB)
Compare_Radon_2.C (20.9 KB)

Could you post the most important and missing file “Compare_Radon_2.h” ?

Rene

Dear Rene, the file was in the first posto …, but i upload here again.
Compare_Radon_2.h (5.87 KB)

You will see that i’m not a good writer.
Is there any way i can improve my code style???

Any good book? or I have only to read some good source code?

If you include thinks like , then you should make declarations like

std::vector<something> or

using namespace std; // not recommended vector <something>
Your files are mising many declarations. For example, you must

#include<iostream> #include <cmath>
and replace cout by std::cout (unless you use the not recommended “using namespace std”

To see the other problems, I suggest to compile first with the native compiler, doing

g++ -c `root-config --cflags` Compare_Radon_2.C
Rene

Hello, I have followed your advicies but now gave me this thing!


  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.18/00   16 January 2008   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.18/00 (trunk@21744, Jan 17 2008, 15:35:00 on macosx)

CINT/ROOT C/C++ Interpreter version 5.16.29, Jan 08, 2008
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .L Compare_Radon_2.C+
Info in <TUnixSystem::ACLiC>: creating shared library /Users/ ... my path ..././Compare_Radon_2_C.so
Error: Missing closing brace for the block opened around line 11.
Error: Unexpected end of file (G__exec_statement()) /var/tmp/tmp.1.SwcCcO_cint.cxx:2:
Error: Missing one of ';,(' expected at or after line 2.
Error: Unexpected end of file (G__fgetname():2) /var/tmp/tmp.1.SwcCcO_cint.cxx:2:
Error: Missing one of '*&,;=():}' expected at or after line 2.
Error: Unexpected end of file (G__fgetvarname():2) /var/tmp/tmp.1.SwcCcO_cint.cxx:2:
Error: Missing one of ',;=():' expected at or after line 2.
Error: Unexpected end of file (G__fgetstream():2) /var/tmp/tmp.1.SwcCcO_cint.cxx:2:
Syntax Error:  Maybe missing ';' /var/tmp/tmp.1.SwcCcO_cint.cxx:2:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing /Users/ ... my path ..././tmp_0_3uwcDb.cxx /Users/ ... my path ..././tmp_0_3uwcDb.h !!!
Error: rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
Info in <ACLiC>: Invoking compiler to check macro's validity
/Users/ ... my path ..././Compare_Radon_2.C: In function ‘void CompareRadonBXFilled(char*, char*, bool)’:
/Users/ ... my path ..././Compare_Radon_2.C:322: warning: unused variable ‘status2’
/Users/ ... my path ..././Compare_Radon_2.C:343: warning: unused variable ‘rBiMi’
/Users/ ... my path ..././Compare_Radon_2.C:345: warning: unused variable ‘rPoMi’
/Users/ ... my path ..././Compare_Radon_2.C:392: warning: comparison between signed and unsigned integer expressions
/Users/ ... my path ..././Compare_Radon_2.C:432: warning: unused variable ‘status2’
/Users/ ... my path ..././Compare_Radon_2.C:453: warning: unused variable ‘rBiMi’
/Users/ ... my path ..././Compare_Radon_2.C:455: warning: unused variable ‘rPoMi’
/Users/ ... my path ..././Compare_Radon_2.C:205: warning: unused variable ‘CMinPo’
/Users/ ... my path ..././Compare_Radon_2.C:205: warning: unused variable ‘CMaxPo’
/Users/ ... my path ..././Compare_Radon_2.C:205: warning: unused variable ‘CMinBi’
/Users/ ... my path ..././Compare_Radon_2.C:205: warning: unused variable ‘CMaxBi’
/Users/ ... my path ..././Compare_Radon_2.C:266: warning: unused variable ‘hrBiPoMi’
/Users/ ... my path ..././Compare_Radon_2.C:267: warning: unused variable ‘hrhtMi’
/Users/ ... my path ..././Compare_Radon_2.C:269: warning: unused variable ‘GOODhrBiPoMi’
/Users/ ... my path ..././Compare_Radon_2.C:270: warning: unused variable ‘zoom_GOODhrBiPoMi’
/Users/ ... my path ..././Compare_Radon_2.C:271: warning: unused variable ‘GOODhrhtMi’
/Users/ ... my path ..././Compare_Radon_2.C:273: warning: unused variable ‘GOODhX2Y2zMi’
/Users/ ... my path ..././Compare_Radon_2.C:275: warning: unused variable ‘hX2Y2zMi’
/Users/ ... my path ..././Compare_Radon_2.C:277: warning: unused variable ‘hBiMuon’
/Users/ ... my path ..././Compare_Radon_2.C:278: warning: unused variable ‘hPoMuon’
/Users/ ... my path ..././Compare_Radon_2.C:280: warning: unused variable ‘ttBi’
/Users/ ... my path ..././Compare_Radon_2.C:281: warning: unused variable ‘ttPo’
/Users/ ... my path ..././Compare_Radon_2.C:283: warning: unused variable ‘ttBiI’
/Users/ ... my path ..././Compare_Radon_2.C:284: warning: unused variable ‘ttPoI’
/Users/ ... my path ..././Compare_Radon_2.C:285: warning: unused variable ‘ttBiO’
/Users/ ... my path ..././Compare_Radon_2.C:286: warning: unused variable ‘ttPoO’
/Users/ ... my path ..././Compare_Radon_2.C:288: warning: unused variable ‘hBiCharge’
/Users/ ... my path ..././Compare_Radon_2.C:289: warning: unused variable ‘hPoCharge’
/Users/ ... my path ..././Compare_Radon_2.C:291: warning: unused variable ‘hBiHits’
/Users/ ... my path ..././Compare_Radon_2.C:292: warning: unused variable ‘hPoHits’
/Users/ ... my path ..././Compare_Radon_2.C:294: warning: unused variable ‘GOODhBiCharge’
/Users/ ... my path ..././Compare_Radon_2.C:295: warning: unused variable ‘GOODhPoCharge’
/Users/ ... my path ..././Compare_Radon_2.C:297: warning: unused variable ‘GOODhBiHits’
/Users/ ... my path ..././Compare_Radon_2.C:298: warning: unused variable ‘GOODhPoHits’
/Users/ ... my path ..././Compare_Radon_2.C:300: warning: unused variable ‘hBiClus_x_mi’
/Users/ ... my path ..././Compare_Radon_2.C:301: warning: unused variable ‘hBiClus_y_mi’
/Users/ ... my path ..././Compare_Radon_2.C:302: warning: unused variable ‘hBiClus_z_mi’
/Users/ ... my path ..././Compare_Radon_2.C:303: warning: unused variable ‘hPoClus_x_mi’
/Users/ ... my path ..././Compare_Radon_2.C:304: warning: unused variable ‘hPoClus_y_mi’
/Users/ ... my path ..././Compare_Radon_2.C:305: warning: unused variable ‘hPoClus_z_mi’
/Users/ ... my path ..././Compare_Radon_2.C:307: warning: unused variable ‘hdt’
/Users/ ... my path ..././Compare_Radon_2.C:308: warning: unused variable ‘GOODhdt’
/Users/ ... my path ..././Compare_Radon_2.C:423: warning: unused variable ‘exist_file1_evnum’
/Users/ ... my path ..././Compare_Radon_2.C:474: warning: ‘fellow_type’ is used uninitialized in this function
/Users/ ... my path ..././Compare_Radon_2.C:496: warning: ‘fellow_type’ is used uninitialized in this function
Info in <ACLiC>: The compiler has not found any problem with your macro.
	Probably your macro uses something rootcint can't parse.
	Check http://root.cern.ch/root/Cint.phtml?limitations for Cint's limitations.

If there is a bad design, i will redo the thing!
Thanks for your help and your time!
Compare_Radon_2.h (5.98 KB)
Compare_Radon_2.C (21 KB)

Remove the comment with the special characters in the statement

Bi_Fellow=-1;//0 è tipo opposto | 1 è dello stesso tipo | -1 non c'è The last character fakes a LF/CR that confuses CINT

Rene

Thanks a lot
I thought that i could write anything after //
I will remeber it in the future

You can comments after “//”. The problem in your case was the accented character at the very end that confues CINT as it mimics a CR/LF

Rene