I’m able to pass multidimensional arrays (1-dim through 4-dim) to a function when I run it in CINT. If I try to compile it using ACLIC, it fails. How can I get it to compile correctly. Thanks.
Ramon
#include <iostream>
using namespace std;
void test() {
Int_t a[2][3] = { {3,4,5} , {6,7,8} };
funcPrint(a);
}
void funcPrint(Int_t a[][3]) {
for (Int_t i =0; i < 2; i++) {
for (Int_t k = 0; k < 3; k++) {
cout << a[i][k] << "\t";
}
cout << endl;
}
}
Processing test.C++…
Info in TUnixSystem::ACLiC: creating shared library /media/SPARE/star/./test_C.so
In file included from /media/SPARE/star/./test_C_ACLiC_dict.h:33,
from /media/SPARE/star/./test_C_ACLiC_dict.cxx:16:
/media/SPARE/star/./test.C: In function ‘void test()’:
/media/SPARE/star/./test.C:5: error: ‘funcPrint’ was not declared in this scope
g++: /media/SPARE/star/./test_C_ACLiC_dict.o: No such file or directory
Error in : Compilation failed!
Error: Function test() is not defined in current scope :0:
*** Interpreter error recovered ***