Hello. I am new to Cling. I downloaded and compiled Cling using the build script at root.cern.ch/drupal/content/clin … structions. Currently the src/ directory created by the above script is at 88c56cd6d6aec0c44e9ca5aa96b354c1261a95aa. Please note the following transcript:
$ ./inst/bin/cling
****************** CLING ******************
* Type C++ code and press enter to run it *
* Type .q to exit *
*******************************************
[cling]$ # include <stdio.h>
[cling]$ for ( int j = 0 ; j < 3 ; ++j ) printf("%d\n", j) ;
0
1
2
[cling]$ for ( int j = 0 ; j < 3 ; ++j )
[cling]$ printf("%d\n", j) ;
input_line_7:2:17: error: use of undeclared identifier 'j'
printf("%d\n", j) ;
^
[cling]$
Is this a known bug? Or should I report it? Thanks.
Hello, but in standard C++ I don’t need the braces. Are you saying that in Cling due to the limitations if I need to continue a statement block I should terminate the first line by } so it will wait for the { before parsing? Is there documentation anywhere that says so? (I did google for it but might have missed something.)
Note that [quote=“Cling - ROOT”]Cling is capable to parse everything that Clang can do.[/quote] and Clang can certainly compile it whether the printf is on a separate line or the same…