Closed
Description
I tried to use the cpp_source to source an example C++ function into R but got the error message:
Error in dyn.load(shared_lib, local = TRUE, now = TRUE) :
unable to load shared object '/tmp/RtmpGrs3dk/file228a974141e9d/src/cpp11.so':
/tmp/RtmpGrs3dk/file228a974141e9d/src/cpp11.so: cannot open shared object file: No such file or directory
The example C++ function is
double mean_cpp(doubles x) {
int n = x.size();
double total = 0;
for(double value : x) {
total += value;
}
return total / n;
}
When I put it into cpp_function, it worked. I have worked with Rcpp before but have never encountered such issue.
Metadata
Metadata
Assignees
Labels
No labels