1 Reply Latest reply on Jun 6, 2018 3:23 AM by george.gousios

    Error in Rcpp::sourceCpp("R.cpp") : Error 1 occurred building shared library.

    george.gousios

      Hello,

       

      I am trying to load cpp file and I am getting the above message.

       

      I don't know if it is possible to do that, though.

       

      R.cpp:

       

      #include <Rcpp.h>
      
      using namespace Rcpp;
      
        
      
      // [[Rcpp::export]]
      NumericVector myFun(NumericVector One)
      {
        int N = One.size();
      
        NumericVector result(N);
        
        for (int i = 0; i < N; ++i)
        {
          result[i] = 2 * One[i];
        }
        
        return result;
      }