Hello,<br><br>We cross-posted. Yes, you're right. I misunderstood the use of includes - global - that is a good way of thinking about it.<br><br>Thanks for everything.<br><br>Simon<br><br><div class="gmail_quote">On Wed, Oct 12, 2011 at 2:06 PM, Darren Cook <span dir="ltr"><<a href="mailto:darren@dcook.org">darren@dcook.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">> pertain to packages. So I will post the relevant code here, and the full<br>
> output from verbose=TRUE below it:<br>
<br>
</div>I think the verbose output was missing from your email (?).<br>
<div class="im"><br>
> linktest<-cxxfunction( signature( vec = "numeric", len = "integer" ), paste(<br>
> readLines(<br>
> "/home/simon/College/PackageOne/src/BZip/LinkTestWrap.cpp"),collapse = "\n"<br>
> ) , plugin = "Rcpp",verbose=TRUE )<br>
</div>> ...<br>
<div class="im"><br>
> 2. LinkTestWrap.cpp: Rcpp Wrapping Function (for use by inline)<br>
> #include <Rcpp.h><br>
> #include <vector><br>
> #include "/home/simon/College/PackageOne/src/BZip/LinkTest.h"<br>
><br>
> using std::vector;<br>
><br>
> vector<int> input_vector( as< vector<int> >( vec ) );<br>
> int length = as<int> ( len );<br>
><br>
> int res = sumvec( input_vector );<br>
><br>
> return Rcpp::wrap( res );<br>
<br>
</div>Does this mean you have three #include statements inside your function<br>
body? The cxxfunction has an includes parameter where you should put<br>
them. I think of "includes" as meaning "global stuff". So you could put<br>
your "using std::vector" line in there too (that is just a style<br>
difference, though).<br>
<br>
Also, IIRC, plugin="Rcpp" implies the #include <Rcpp.h>, so you should<br>
be able to drop that.<br>
<div><div></div><div class="h5"><br>
Darren<br>
<br>
--<br>
Darren Cook, Software Researcher/Developer<br>
<br>
<a href="http://dcook.org/work/" target="_blank">http://dcook.org/work/</a> (About me and my work)<br>
<a href="http://dcook.org/blogs.html" target="_blank">http://dcook.org/blogs.html</a> (My blogs and articles)<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></blockquote></div><br>