Re: Erratic TInterpreter::GetInterfaceMethod behaviour?

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Wed, 30 Mar 2011 13:16:17 -0500


Hi,

In CINT the actual checking of the content of the function is delayed until their are used. So LoadMacro indeed does succeed (i.e. a function of the proper name is registered as existing and having the right prototype) but upon used an error is issued.

Cheers,
Philippe.

On 3/30/11 3:28 AM, Nicholas Devenish wrote:
> Hi,
>
> I understand the problem now, but it seems strange that the LoadMacro
> reported success when it clearly didn't work. I have now added
> TApplication, and it is fine.
>
> Is there documentation somewhere for this behaviour? The only
> references to TRInt/TApplication that I can find in the users guide
> are in relation to running GUI applications.
>
> Thanks,
>
> Nick
>
> On Tue, Mar 29, 2011 at 9:00 PM, Philippe Canal<pcanal_at_fnal.gov> wrote:
>> Hi Nicholas,
>>
>> Per se it is the intended behavior. When not constructing a TRint, you
>> forgo
>> some of its functionality. One of the functionality is to introduce more
>> 'state'
>> and initialization than the (intentionally) bare minimum.
>>
>> In your original example, you try to interpret:
>>
>> void infid_set_cc2008()\n{\n cout<< \"This works\"<<endl;\n}\n
>>
>> which requires 'iostream'. I.e. an alternative (and semantically
>> consistent)
>> solution is to use:
>>
>> thefile<< "#include<iostream>\nvoid infid_set_cc2008()\n{\n cout<<
>> \"This works\"<<endl;\n}\n";
>>
>> Cheers,
>> Philippe.
>>
>>
>> On 3/28/11 6:44 AM, Nicholas Devenish wrote:
>>> Hi Bertrand,
>>>
>>> On Mon, Mar 28, 2011 at 11:52 AM, Bertrand Bellenot
>>> <Bertrand.Bellenot_at_cern.ch> wrote:
>>>> For me, adding gROOT->ProcessLine("#include<iostream>"); in your main()
>>>> solved the problem. I.e.:
>>> Thanks! - this works around the problem and allows me to continue with
>>> my work. At a hazardous guess, I can imagine it is something to do
>>> with the interpreter not being properly initialised until it is passed
>>> a valid command to parse (i.e. initialisation order), though I admit
>>> the couple of other items I tried didn't work. Perhaps I should file a
>>> savannah report.
>>>
>>> Nick
>>>
Received on Wed Mar 30 2011 - 20:16:22 CEST

This archive was generated by hypermail 2.2.0 : Thu Mar 31 2011 - 05:50:01 CEST