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 Tue Mar 29 2011 - 22:00:41 CEST
This archive was generated by hypermail 2.2.0 : Wed Mar 30 2011 - 11:50:01 CEST