Hello, We cross-posted. Yes, you're right. I misunderstood the use of includes - global - that is a good way of thinking about it.
Thanks for everything. Simon On Wed, Oct 12, 2011 at 2:06 PM, Darren Cook <dar...@dcook.org> wrote: > > pertain to packages. So I will post the relevant code here, and the full > > output from verbose=TRUE below it: > > I think the verbose output was missing from your email (?). > > > linktest<-cxxfunction( signature( vec = "numeric", len = "integer" ), > paste( > > readLines( > > "/home/simon/College/PackageOne/src/BZip/LinkTestWrap.cpp"),collapse = > "\n" > > ) , plugin = "Rcpp",verbose=TRUE ) > > ... > > > 2. LinkTestWrap.cpp: Rcpp Wrapping Function (for use by inline) > > #include <Rcpp.h> > > #include <vector> > > #include "/home/simon/College/PackageOne/src/BZip/LinkTest.h" > > > > using std::vector; > > > > vector<int> input_vector( as< vector<int> >( vec ) ); > > int length = as<int> ( len ); > > > > int res = sumvec( input_vector ); > > > > return Rcpp::wrap( res ); > > Does this mean you have three #include statements inside your function > body? The cxxfunction has an includes parameter where you should put > them. I think of "includes" as meaning "global stuff". So you could put > your "using std::vector" line in there too (that is just a style > difference, though). > > Also, IIRC, plugin="Rcpp" implies the #include <Rcpp.h>, so you should > be able to drop that. > > Darren > > -- > Darren Cook, Software Researcher/Developer > > http://dcook.org/work/ (About me and my work) > http://dcook.org/blogs.html (My blogs and articles) > _______________________________________________ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel >
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel