<div dir="ltr">Hi Kevin,<div><br></div><div>I am running R with RStudio. The OS is windows 7 64bit. Here is my sessionInfo() output. </div><div><div><div>R version 2.15.3 (2013-03-01)</div><div>Platform: x86_64-w64-mingw32/x64 (64-bit)</div>
<div><br></div><div>locale:</div><div>[1] LC_COLLATE=English_United States.1252  LC_CTYPE=C                            </div><div>[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          </div><div>
[5] LC_TIME=English_United States.1252    </div><div><br></div><div>attached base packages:</div><div>[1] stats     graphics  grDevices utils     datasets  methods   base     </div><div><br></div><div>other attached packages:</div>
<div>[1] Rcpp_0.10.2</div><div><br></div><div>loaded via a namespace (and not attached):</div><div>[1] tools_2.15.3</div></div></div><div><br></div><div style>My R.home...</div><div style><div>R.home()</div><div>[1] "C:/R/R-215~1.3"</div>
</div><div><br></div><div>I have both R 3.0.0 and 2.15.3 installed in my computer, both at C:\R. and I have Rtools30 installed. <br></div><div style>All these are added in my path. </div><div style><br></div><div style>I also uninstalled all of them and re-installed but the error is persistent.</div>
<div style>As I said, if I write a function and added it to my package \src folder and build, it works perfectly fine but none of the individual functions can't be compiled ( which were working perfectly earlier).</div>
<div style><br></div><div style><br></div><div style>Please let me know if you need any further information on this.. Thanks a lot.</div><div style><br></div><div style><br></div><div style>Subodh</div><div style><br></div>
<div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 28, 2013 at 11:15 PM, Kevin Ushey <span dir="ltr"><<a href="mailto:kevinushey@gmail.com" target="_blank">kevinushey@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Subodh,<div><br></div><div>Can you give some more information about your system -- specifically, the output of sessionInfo() in an R session? Also, are you running this from an R session in your terminal, or some other system (RStudio, RKWard etc.)</div>

<div><br></div><div>-Kevin</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Sun, Apr 28, 2013 at 7:20 PM, Subodh Acharya <span dir="ltr"><<a href="mailto:shoebodh@gmail.com" target="_blank">shoebodh@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi, I am a beginner-class use of the amazing Rcpp. I am using to simulate finite state Markov chains. <div>

Previously all the c++ function I wrote were working perfectly. I compiled all my functions in package and they work fine.</div>
<div><br></div><div>But now after I updated to Rcpp 0.10.3, whenever I sourceCpp, it throws a 'unused arguement' error.</div><div><div>However when I use the all the functions to build a package, it works fine.</div>


<div><br></div><div>I think  this is a really small problem, but its beyond my knowledge of c++ </div><div>Any help will be greatly appreciated.</div></div><div><br></div><div>Following are simple  example codes and the error I am getting.. <br>


</div><div><br></div><div><br></div><div><br></div><div><div>cppFunction('</div><div>+   int add(int x, int y, int z) {</div><div>+     int sum = x + y + z;</div><div>+     return sum;</div><div>
+   }'</div><div>+ )</div><div>Error in Rcpp:::sourceCppFunction(function(x, y, z) { : </div><div>  unused argument ("sourceCpp_94801_add")</div><div><br></div><div><br></div><div>Second example code </div>


<div><br></div><div>  #include <Rcpp.h><br></div><div><div>#include <iostream></div><div>#include <vector></div><div><br></div><div>// [[Rcpp::export]]</div><div><br></div><div>using namespace Rcpp;</div>


<div>using namespace std;</div><div><br></div><div> </div><div>int mcfunC(int oldState, NumericVector states, NumericMatrix prob_mat){</div><div><br></div><div>RNGScope scope;</div><div><br></div><div>NumericVector newState(1);</div>


<div><br></div><div>int pixel = oldState;</div><div><br></div><div>  Environment base("package:base");</div><div>  Function sample = base["sample"];</div><div> </div><div> newState = sample(states, Named("size", 1), Named("prob", prob_mat(pixel, _)));</div>


<div>  </div><div> int state_new = newState[0];</div><div>  </div><div>  return(state_new);</div><div>  </div><div> }</div><div>  </div><div><br></div><div> Rcpp::sourceCpp('src/mcfunC.cpp')<br></div><div>
Error in Rcpp:::sourceCppFunction(function(oldState, states, prob_mat) { : </div><div>  unused argument ("sourceCpp_20302_mcfunC") </div><div>  </div><div>  </div><div>Thanks in advance.</div></div><div>
<br></div></div></div>
<br></div></div>_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">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><span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div>
<br></div>-- <br><div dir="ltr">-Kevin</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div><br>
</div></div>