I want to embed R in a C ++ program. So I installed R, Rcpp and RInside. But during compilation with g ++ on UNIX, I get many undefined references to "errors". The command I give to compile
g ++ -I / path / to / R / include -I / path / to / Rcpp / include -I / path / to / RInside / include -L / path / to / R / libs -L / path / to / Rcpp / libs -L / path / to / RInside / libs test.cpp -lRlapack -lRcpp -lRblas -lRInside "
test.cpp:
#include <RInside.h>
int main(int argc, char *argv[]) {
RInside R(argc, argv);
R["txt"] = "Hello, world!\n";
R.parseEvalQ("cat(txt)");
exit(0);
}
Errors:
Undefined reference to R_ClassSymbol
Undefined reference to R_NilValue
I get similar 110 undefined errors for R variables. I installed R and other packages in my location, not the default. I am stuck with this error for 2 days. I seem to be doing everything right, like binding, etc. Thanks in advance.