I have a problem in building the basic example rcpp_hello_world. I have followed the example referred at http://blog.fellstat.com/?p=170
It is all ok up to the linking, when I find the following error
Building target: MyCppPackage_4
Invoking: Cross G++ Linker
g++ -L/usr/local/R/lib64/R/lib -o "MyCppPackage_4" ./src/RcppExports.o ./src/main.o ./src/rcpp_hello_world.o /usr/local/R/lib64/R/library/Rcpp/libs/Rcpp.so /usr/local/R/lib64/R/library/RInside/lib/libRInside.so -lR -lRblas
./src/main.o: In function `main':
/home/luigi/workspace-mars/MyCppPackage_4/Debug/../src/main.cpp:22: undefined reference to `rcpp_hello_world'
collect2: error: ld returned 1 exit status
make: *** [MyCppPackage_4] Error 1
here the code of the main.cpp file
/*
* main.cpp
*
* Created on: Jun 13, 2016
* Author: luigi
*/
#ifdef INSIDE
#include <Rcpp.h>
#include <RInside.h> // for the embedded R via RInside
#include "rcpp_hello_world.h"
using namespace Rcpp;
using namespace std;
//RcppExport SEXP rcpp_hello_world();
#include <unistd.h>
int main(int argc, char *argv[]) {
RInside R(argc, argv); // create an embedded R instance
SEXP s = rcpp_hello_world();
Language call("print",s);
call.eval();
return 0;
}
#endif
I'm sorry for disordered post I'm thankful for any hint