Dirk, thanks for your quick response. Here&#39;s the command:<div><br></div><div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
&gt; src &lt;- &#39;<br>+ Rcpp::NumericVector xa(a);<br>+ Rcpp::NumericVector xb(b);<br>+ int n_xa = xa.size(), n_xb = xb.size();<br>+<br>+ Rcpp::NumericVector xab(n_xa + n_xb - 1);<br>+ for (int i = 0; i &lt; n_xa; i++)<br>
+ for (int j = 0; j &lt; n_xb; j++)<br>+ xab[i + j] += xa[i] * xb[j];<br>+ return xab;<br>&#39; +<br>&gt; fun &lt;- cxxfunction(<br>+ signature(a=&quot;numeric&quot;, b=&quot;numeric&quot;),<br>+ src, plugin=&quot;Rcpp&quot;)</blockquote>
</div><br><div class="gmail_quote">On Sun, Mar 20, 2011 at 8:30 PM, Dirk Eddelbuettel <span dir="ltr">&lt;<a href="mailto:edd@debian.org">edd@debian.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi Henry,<br>
<div class="im"><br>
On 20 March 2011 at 20:11, Henry Bee wrote:<br>
| Hi Dirk,<br>
|<br>
| I&#39;ve been developing with R for the past year and came across your wonderful<br>
| presentation slides on Rcpp a few months ago. I am now turning to your Rcpp<br>
| package to translate the slowest portion of my code to C/C++. <br>
<br>
</div>Great, welcome aboard!<br>
<div class="im"><br>
| I am testing the first example provided on page 6 in<br>
| your Rcpp-introduction.pdf document. Unfortunately I am getting compile errors<br>
| (listed below). Could you provide some guidance?<br>
<br>
</div>You showed the outcome, you did not show the exact command you ran. Could you<br>
post that as well, please?<br>
<br>
Dirk<br>
<div><div></div><div class="h5"><br>
|<br>
| Kind regards,<br>
|<br>
| Henry<br>
|<br>
|<br>
|<br>
|     ERROR(s) during compilation: source code errors or compiler configuration<br>
|     errors!<br>
|     Program source:<br>
|       1: <br>
|       2: // includes from the plugin<br>
|       3: <br>
|       4: #include &lt;Rcpp.h&gt;<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 &quot;C&quot; {<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 &lt; n_xa; i++)<br>
|      37:  for (int j = 0; j &lt; 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 &#39;C:\PROGRA~1\R\R-212~1.2/bin/i386/R CMD SHLIB<br>
|     file3665625e.cpp 2&gt; file3665625e.cpp.err.txt&#39; had status 1 <br>
|<br>
|<br>
|<br>
|<br>
|<br>
</div></div>| ----------------------------------------------------------------------<br>
| _______________________________________________<br>
| Rcpp-devel mailing list<br>
| <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
| <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
<div><div></div><div class="h5"><br>
--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</div></div></blockquote></div><br>