Skip to content
Prev 3866 / 10988 Next

[Rcpp-devel] Including a compiled function with inline

On Mon, Jun 4, 2012 at 4:19 AM, Marie Auger-Methe
<marie.augermethe at gmail.com> wrote:
Unfortunately, it's complicated if you want to access the compiled
code from another package.   There is a mechanism for another
package's compiled C functions but it is somewhat unwieldy.  If you
want to access another package's compiled C++ classes and methods and
stand-alone functions you need to arrange for the compiled code to be
in a known location and have this location on the path for the loader.
 The Rcpp package does this but getting the details right on multiple
platforms is tricky.

Perhaps the easiest approach is to include not only the headers but
all the C++ code in the file listed in the includes argument to
cxxfunction.  It's a bit wasteful but at least it works. :-)