Why rootcint deletes its input file?

Hi,

I am trying to make a dictionary to my new class. The message I receive is

[quote]C:\veghj\projects\root\ewa>rootcint tdocfile.cxx -c tdocfile.h
#error tdocfile.h/C is only for compilation. Abort cint.
Error: link requested for unknown class tdocfile FILE:G__auto1144LinkDef.h LINE:7
Warning: Error occured during reading source files
Warning: Error occured during dictionary source generation
!!!Removing tdocfile.cxx tdocfile.h !!!
Error: rootcint: error loading headers…
[/quote]
I did it as shown in the docs and I am surprised on the messages.

1./ Why rootcint deletes its input file? I agree it shall delete the wrong output file it creates, but I think it is very unfriendly that it deletes my input file. Accidentally I have a backup in another directory, but how can I correct the mistake if the input file is deleted? If this is absolutely necessary, the docs must warn that I might loose my work when experimenting with this utility.
Shall I be prepared for similar kind actions from the other utilities?

2./ Where can I find out what is the problem? I do not find the message “#error tdocfile.h/C is only for compilation. Abort cint.” very informative.

3./ From the temporary file (which, interestingly enough, is not deleted) I find that in line 7

the class name is taken from the file name of the header file, rather than the content of the file. Why is it so? As far as I know it is not necessary at all to give the name of the class to the header file. In my case, it is so, but Windows is not case sensitive, so I used lower case only. What if the header contains more than one class?

BTW: after correcting the command there is no real change, although TDocFile is there in the file (until the command deletes it).

[quote]C:\veghj\projects\root\ewa>rootcint tdocfile.cxx -c TDocFile.h

Error: link requested for unknown class TDocFile FILE:G__auto2736LinkDef.h LINE:7

#pragma link C++ class TDocFile;
[/quote]

4./ In general: I receive several lines of error messages, but neither of them gives a hint what is wrong. Could this utility be made a little more user friendly?
So, I am sorry, but could you please advice what is wrong with my file rootcint does not like? I cannot figure out myself. The code is attached.

Janos
TDocFile.h (2.62 KB)

Hi, let me try just a little bit of troubleshooting:
In your case, wouldn’t the correct command to call rootcint be:

rootcint -f tdocfileDict.cxx -c tdocfile.h

This might explain your data loss during the invocation.

Hi,

thanks for the tip. Maybe I did not give the correct output filename. I think however,
1./ The output file should be generated anyhow (it is a different question, if I can use it with this non-standard name)
2./ A user-created input file must not be deleted, any condition.
3./ The error messages/warnings are informative a la Redmont. At least I cannot conclude it is soemthing wrong with the file name.

Regards
Janos

Note that the output from rootcint filename.cxx ....is exactly 2 files ‘filename.cxx’ and ‘filename.h’. So in your case, the output can not be generated without overwriting the input file.\

[quote]2./ A user-created input file must not be deleted, any condition. [/quote]You are (of course) right, we will try to add the needed protection.

Cheers,
Philippe.

Hi,

The rootcint code now in CVS checks against this type of accidentla overwrite.

Thanks for reporting this problem.
Philippe.