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