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,


 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Error-using-Rcpp-under-windows-xp-tp3070578p3070578.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to