<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hello, <br>
    <br>
    It looks like you want to use Rcpp modules. See the "Rcpp-modules"
    vignette.<br>
    <br>
    &gt; require( Rcpp )<br>
    &gt; vignette( "Rcpp-modules" )<br>
    <br>
    Or from CRAN: <br>
    <br>
<a class="moz-txt-link-freetext" href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf">http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf</a><br>
    <br>
    Modules are still in (slow) dev, so they lack some features, but
    what exists already might answer your needs. <br>
    <br>
    Romain<br>
    <br>
    Le 10/10/11 12:09, Simon Fuller a &eacute;crit&nbsp;:
    <blockquote
cite="mid:CAFpt1=Ju3aZi8TDif=vXH-9S--NygJE9LfTuKKMgNAua_CCOGg@mail.gmail.com"
      type="cite">Hello,<br>
      <br>
      I have just joined the mailing list.<br>
      <br>
      I was hoping you might be able to help me with a question.<br>
      <br>
      I am new to Rcpp, have some experience with both R and C++, but
      very little experience with integrating languages.<br>
      <br>
      I hope to use Rcpp to develop code over the next few years.
      However, to begin with, I have some preexisting C++ classes that I
      would like to make available to R.<br>
      <br>
      I have read the documentation that I can find, but I do not know
      which is the best approach to take.<br>
      <br>
      I only, in principle, need <i>one method</i> to interact with the
      classes - there then follows a fairly arduous process using
      different tree structures each of which have aggregate classes,
      but only a single double needs to be returned to R.<br>
      <br>
      I was therefore hoping to simply call a C++ wrapper function
      in-line, remotely, which in turn called my classes, but that does
      not work. I get an:<br>
      "expected unqualified-id before &#8216;extern&#8217; " error after my
      includes, at: RcppExport SEXP..&nbsp; at the start of my method
      declaration. (I can post code if this approach is not a complete
      dead end)<br>
      <br>
      So my two questions are: is there a quick way of prototyping this?
      i.e. to get R to invoke my classes through an rcpp intermediary. <br>
      <br>
      If there is not a quick way to do this, what is the best approach?
      Do I need to, and if so how do I, make my classes accessible to
      Rcpp. Because my whole hope here is to use preexisting code as
      swiftly as possible, 'easiest' and 'quickest' are almost synonyms
      for 'best' in my question.<br>
      <br>
      If someone could point me in the direction of some example code
      where Rcpp invokes user classes this would be great.<br>
      <br>
      My apologies if my question has been covered before, but I would
      really appreciate some advice on what is and is not possible, and
      some strategic advice on the best (easiest and quickest) approach.
      <br>
      <br>
      Thank you for your help. It is deeply appreciated.<br>
      <br>
      Simon<br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Rcpp-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Romain Francois
Professional R Enthusiast
<a class="moz-txt-link-freetext" href="http://romainfrancois.blog.free.fr">http://romainfrancois.blog.free.fr</a></pre>
  </body>
</html>