I install cling using the instructions here Cling Build Instructions - ROOT. The installation was successful and can use cling anywhere in my bash shell. I created a test script which looks like
script.cxx
//#! /usr/local/bin/cling --metastr=//.
#include <iostream>
using namespace std;
void script(){
std::cout << "This is a test" << std::endl;
}
Executing this script in cling works without error. But executing the below script shows the error.
script.cxx:
//#! /usr/local/bin/cling --metastr=//.
#include <iostream>
using namespace std;
int script(){
std::cout << "This is a test" << std::endl;
return 0;
}
****************** CLING ******************
* Type C++ code and press enter to run it *
* Type .q to exit *
*******************************************
[cling]$ .x script.cxx
This is a test
In file included from input_line_5:1:
xxxxx/include/cling/Interpreter/RuntimePrintValue.h:249:33: warning: template template parameter using 'typename' is a C++17 extension [-Wc++17-extensions]
template <template <class...> typename TUPLE, typename... ARGS,
^~~~~~~~
class
xxxxx/include/cling/Interpreter/RuntimePrintValue.h:260:8: warning: pack fold expression is a C++17 extension [-Wc++17-extensions]
...);
^
xxxxx/include/cling/Interpreter/RuntimePrintValue.h:263:10: error: no member named 'apply' in namespace 'std'
std::apply(concatToStr, *val);
~~~~~^
(int) 0