<div class="gmail_quote"><div>Hi Dirk,</div><div><br></div><div>I've been developing with R for the past year and came across your wonderful presentation slides on Rcpp a few months ago. I am now turning to your Rcpp package to translate the slowest portion of my code to C/C++. </div>
<div><br></div><div>I am testing the first example provided on page 6 in your Rcpp-introduction.pdf document. Unfortunately I am getting compile errors (listed below). Could you provide some guidance?</div><div><br></div>
<div>Kind regards,</div><div><br></div><div>Henry</div><div><br></div><div><br></div><div><blockquote>ERROR(s) during compilation: source code errors or compiler configuration errors!<br>Program source:<br> 1: <br> 2: // includes from the plugin<br>
3: <br> 4: #include <Rcpp.h><br> 5: <br> 6: <br> 7: #ifndef BEGIN_RCPP<br> 8: #define BEGIN_RCPP<br> 9: #endif<br> 10: <br> 11: #ifndef END_RCPP<br> 12: #define END_RCPP<br> 13: #endif<br> 14: <br> 15: using namespace Rcpp;<br>
16: <br> 17: <br> 18: // user includes<br> 19: <br> 20: <br> 21: // declarations<br> 22: extern "C" {<br> 23: SEXP file3665625e( SEXP a, SEXP b) ;<br> 24: }<br> 25: <br> 26: // definition<br> 27: <br> 28: SEXP file3665625e( SEXP a, SEXP b ){<br>
29: BEGIN_RCPP<br> 30: <br> 31: Rcpp::NumericVector xa(a);<br> 32: Rcpp::NumericVector xb(b);<br> 33: int n_xa = xa.size(), n_xb = xb.size();<br> 34: <br> 35: Rcpp::NumericVector xab(n_xa + n_xb - 1);<br> 36: for (int i = 0; i < n_xa; i++)<br>
37: for (int j = 0; j < n_xb; j++)<br> 38: xab[i + j] += xa[i] * xb[j];<br> 39: return xab;<br> 40: <br> 41: END_RCPP<br> 42: }<br> 43: <br> 44: <br>Error in compileCode(f, code, language = language, verbose = verbose) : <br>
Compilation ERROR, function(s)/method(s) not created! <br>In addition: Warning message:<br>running command 'C:\PROGRA~1\R\R-212~1.2/bin/i386/R CMD SHLIB file3665625e.cpp 2> file3665625e.cpp.err.txt' had status 1 </blockquote>
</div><div><br></div><div><br></div>
</div><br>