Hi,
I am a newbie to Rcpp packages, and got problems in having basic set-ups for
Rcpp under windows xp. Here is the list I have done.
1) installed Rtools and have no problem in compiling .c file.
2) installed Rcpp packages
3) set enviroment variables 'path' to make C:\Program
Files\R\R-2.12.0\library\Rcpp\include\ searchable
The sample C++ code I used is from the original website:
http://dirk.eddelbuettel.com/code/rcpp.examples.html
#include<Rcpp.h>
RcppExport SEXP newRcppVectorExample(SEXP vector) {
Rcpp::NumericVector orig(vector); // keep a copy (as the classic
version does)
Rcpp::NumericVector vec(orig.size()); // create a target vector of the
same size
// we could query size via
// int n = vec.size();
// and loop over the vector, but using the STL is so much nicer
// so we use a STL transform() algorithm on each element
std::transform(orig.begin(), orig.end(), vec.begin(), sqrt);
Rcpp::Pairlist res(Rcpp::Named( "result", vec),
Rcpp::Named( "original", orig));
return res;
}
I got bunch of error messages like:
test.o:test.cpp:(.test+0x141): undefined reference to
'RcppResultSet::RcppResultSet()'
...
undefined reference to 'double*
Rcpp::internal::r_vector_start<14,double>(SEXPREC*)'
collect2: ld returned 1 exit status
Can someone help me out?
Thanks,