Hello,<br><br>We cross-posted. Yes, you&#39;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">&lt;<a href="mailto:darren@dcook.org">darren@dcook.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">&gt; pertain to packages. So I will post the relevant code here, and the full<br>
&gt; output from verbose=TRUE below it:<br>
<br>
</div>I think the verbose output was missing from your email (?).<br>
<div class="im"><br>
&gt; linktest&lt;-cxxfunction( signature( vec = &quot;numeric&quot;, len = &quot;integer&quot; ), paste(<br>
&gt; readLines(<br>
&gt; &quot;/home/simon/College/PackageOne/src/BZip/LinkTestWrap.cpp&quot;),collapse = &quot;\n&quot;<br>
&gt; ) , plugin = &quot;Rcpp&quot;,verbose=TRUE )<br>
</div>&gt; ...<br>
<div class="im"><br>
&gt; 2. LinkTestWrap.cpp: Rcpp Wrapping Function (for use by inline)<br>
&gt; #include &lt;Rcpp.h&gt;<br>
&gt; #include &lt;vector&gt;<br>
&gt; #include &quot;/home/simon/College/PackageOne/src/BZip/LinkTest.h&quot;<br>
&gt;<br>
&gt;     using std::vector;<br>
&gt;<br>
&gt;     vector&lt;int&gt; input_vector( as&lt; vector&lt;int&gt; &gt;( vec ) );<br>
&gt;     int length = as&lt;int&gt; ( len );<br>
&gt;<br>
&gt;     int res = sumvec( input_vector );<br>
&gt;<br>
&gt;     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 &quot;includes&quot; as meaning &quot;global stuff&quot;. So you could put<br>
your &quot;using std::vector&quot; line in there too (that is just a style<br>
difference, though).<br>
<br>
Also, IIRC, plugin=&quot;Rcpp&quot; implies the #include &lt;Rcpp.h&gt;, 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>