[Rcpp-devel] Fwd: Call R Shiny app from C++

Fernando Trincado Alonso fernandotrin at gmail.com
Wed Mar 8 10:37:34 CET 2017


Hello to everybody!

I've developed an R Shiny app and I'd like to call this app from a C++
program. I've been reading a lot of information and I still don't see
clearly if I should use Rcpp or RInside to do this. I've been trying to do
it with Rcpp, following the instructions described here:

http://gallery.rcpp.org/articles/r-function-from-c++/

Therefore, I'm trying to compile the next code (I'm using Codeblocks as IDE)

#include <Rcpp.h>

using namespace Rcpp;

// [[Rcpp::export]]
NumericVector callFunction(NumericVector x, Function f) {
    NumericVector res = f(x);
    return res;
}


But I receive a lot of errors like this:

/home/fernandotrin/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include/Rcpp/Rmath.h|35|error:
‘::Rf_dnorm4’ has not been declared|

This error comes from library <Rmath.h>
I think that I've correctly specified the search directories where the
compiler should look for the headers, but I'm still receiving this errors.
What do you recommend?

1) Shoud I use Rinside instead of Rcpp?
2)Should I use a different IDE?
3) Is there any previous requirement to use Rcpp that I have missed?

Thank you very much!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170308/df8e87ba/attachment.html>


More information about the Rcpp-devel mailing list