<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>I apologize if this question has been asked before but after doing several searches I could not find an answer that is directly applicable to my problem. I am working on a package containing a number of Rcpp functions. The package builds and loads without a problem. However, when I call any of the Rcpp functions from within R, I get the following type of error message:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Error in .Call(<pointer: (nil)>, x, xMin, xMax, adjustment) : </p><p class=MsoNormal>  NULL value passed as symbol address</p><p class=MsoNormal>           </p><p class=MsoNormal>As an example, here is the function that returned the error in the C++ file:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>// [[Rcpp::export]]</p><p class=MsoNormal>NumericVector logit(Rcpp::NumericVector x, </p><p class=MsoNormal>                    Rcpp::NumericVector xMin,</p><p class=MsoNormal>                    Rcpp::NumericVector xMax, </p><p class=MsoNormal>                    double adjustment = 0.3) {</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  ...</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>}</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The exported function in RcppExports.cpp:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>// logit</p><p class=MsoNormal>NumericVector logit(Rcpp::NumericVector x, Rcpp::NumericVector xMin, Rcpp::NumericVector xMax, double adjustment);</p><p class=MsoNormal>RcppExport SEXP _MFRM_logit(SEXP xSEXP, SEXP xMinSEXP, SEXP xMaxSEXP, SEXP adjustmentSEXP) {</p><p class=MsoNormal>BEGIN_RCPP</p><p class=MsoNormal>    Rcpp::RObject rcpp_result_gen;</p><p class=MsoNormal>    Rcpp::RNGScope rcpp_rngScope_gen;</p><p class=MsoNormal>    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);</p><p class=MsoNormal>    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type xMin(xMinSEXP);</p><p class=MsoNormal>    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type xMax(xMaxSEXP);</p><p class=MsoNormal>    Rcpp::traits::input_parameter< double >::type adjustment(adjustmentSEXP);</p><p class=MsoNormal>    rcpp_result_gen = Rcpp::wrap(logit(x, xMin, xMax, adjustment));</p><p class=MsoNormal>    return rcpp_result_gen;</p><p class=MsoNormal>END_RCPP</p><p class=MsoNormal>}</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>And the corresponding R file:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>logit <- function(x, xMin, xMax, adjustment = 0.3) {</p><p class=MsoNormal>    .Call(`_MFRM_logit`, x, xMin, xMax, adjustment)</p><p class=MsoNormal>}</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>First, how can there be two functions called "logit"--one in the main C++ file and one in RcppExports.cpp? And where does _MFRM_logit get defined? Might this be causing the problem?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I should note that hte problem is not limited to this one function, but to all the exported C++ functions. </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Second, is there some option in the project or in the C++ files that needs to be set? </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am running R 3.51, RStudio 1.14, and Rcpp (0.12.19).</p></div></body></html>