<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><tt>Dear list</tt></p>
    <p><tt>I a writing a package containing 2 C++ functions using Rcpp
        version 1.00. I am using R version 3.5.3 and devtools version
        2.0.2. I have had devtools/Rcpp generate the RcppExport.cpp and
        RcpExport.R files. The package compiles fine but when I attempt
        to call these C++ functions, I receive a NULL value passed as
        symbol address error. Below is my generated RcppExport.R file:</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt># Generated by using Rcpp::compileAttributes() -> do not
        edit by hand</tt><tt><br>
      </tt><tt># Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393</tt><tt><br>
      </tt><tt><br>
      </tt><tt>logit <- function(x, xMin, xMax, adjustment = 0.3) {</tt><tt><br>
      </tt><tt>    .Call('_MFRM_logit', PACKAGE = 'MFRM', x, xMin, xMax,
        adjustment)</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt><tt><br>
      </tt><tt>#'</tt><tt><br>
      </tt><tt>#' count_valid</tt><tt><br>
      </tt><tt>#' @name count_valid</tt><tt><br>
      </tt><tt>#' @param x A vector of integer values, including missing
        values</tt><tt><br>
      </tt><tt>#' @return An integer representing the number of unique
        non-missing values in x.</tt><tt><br>
      </tt><tt>#' @export</tt><tt><br>
      </tt><tt>#'</tt><tt><br>
      </tt><tt>count_valid <- function(x) {</tt><tt><br>
      </tt><tt>    .Call('_MFRM_count_valid', PACKAGE = 'MFRM', x)</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt><tt><br>
      </tt></p>
    <p><b>And here is RcppExport.cpp:</b></p>
    <p><tt>// Generated by using Rcpp::compileAttributes() -> do not
        edit by hand</tt><tt><br>
      </tt><tt>// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393</tt><tt><br>
      </tt><tt><br>
      </tt><tt>#include <Rcpp.h></tt><tt><br>
      </tt><tt><br>
      </tt><tt>using namespace Rcpp;</tt><tt><br>
      </tt><tt><br>
      </tt><tt>// logit</tt><tt><br>
      </tt><tt>Rcpp::NumericVector logit(Rcpp::NumericVector x,
        Rcpp::NumericVector xMin, Rcpp::NumericVector xMax, double
        adjustment);</tt><tt><br>
      </tt><tt>RcppExport SEXP _MFRM_logit(SEXP xSEXP, SEXP xMinSEXP,
        SEXP xMaxSEXP, SEXP adjustmentSEXP) {</tt><tt><br>
      </tt><tt>BEGIN_RCPP</tt><tt><br>
      </tt><tt>    Rcpp::RObject rcpp_result_gen;</tt><tt><br>
      </tt><tt>    Rcpp::RNGScope rcpp_rngScope_gen;</tt><tt><br>
      </tt><tt>    Rcpp::traits::input_parameter< Rcpp::NumericVector
        >::type x(xSEXP);</tt><tt><br>
      </tt><tt>    Rcpp::traits::input_parameter< Rcpp::NumericVector
        >::type xMin(xMinSEXP);</tt><tt><br>
      </tt><tt>    Rcpp::traits::input_parameter< Rcpp::NumericVector
        >::type xMax(xMaxSEXP);</tt><tt><br>
      </tt><tt>    Rcpp::traits::input_parameter< double >::type
        adjustment(adjustmentSEXP);</tt><tt><br>
      </tt><tt>    rcpp_result_gen = Rcpp::wrap(logit(x, xMin, xMax,
        adjustment));</tt><tt><br>
      </tt><tt>    return rcpp_result_gen;</tt><tt><br>
      </tt><tt>END_RCPP</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt><tt>// count_valid</tt><tt><br>
      </tt><tt>int count_valid(IntegerVector x);</tt><tt><br>
      </tt><tt>RcppExport SEXP _MFRM_count_valid(SEXP xSEXP) {</tt><tt><br>
      </tt><tt>BEGIN_RCPP</tt><tt><br>
      </tt><tt>    Rcpp::RObject rcpp_result_gen;</tt><tt><br>
      </tt><tt>    Rcpp::RNGScope rcpp_rngScope_gen;</tt><tt><br>
      </tt><tt>    Rcpp::traits::input_parameter< IntegerVector
        >::type x(xSEXP);</tt><tt><br>
      </tt><tt>    rcpp_result_gen = Rcpp::wrap(count_valid(x));</tt><tt><br>
      </tt><tt>    return rcpp_result_gen;</tt><tt><br>
      </tt><tt>END_RCPP</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt><tt><br>
      </tt><tt>static const R_CallMethodDef CallEntries[] = {</tt><tt><br>
      </tt><tt>    {"_MFRM_logit", (DL_FUNC) &_MFRM_logit, 4},</tt><tt><br>
      </tt><tt>    {"_MFRM_fitCurve", (DL_FUNC) &_MFRM_fitCurve,
        10},</tt><tt><br>
      </tt><tt>    {"_MFRM_count_valid", (DL_FUNC)
        &_MFRM_count_valid, 1},</tt><tt><br>
      </tt><tt>    {NULL, NULL, 0}</tt><tt><br>
      </tt><tt>};</tt><tt><br>
      </tt><tt><br>
      </tt><tt>RcppExport void R_init_MFRM(DllInfo *dll) {</tt><tt><br>
      </tt><tt>    R_registerRoutines(dll, NULL, CallEntries, NULL,
        NULL);</tt><tt><br>
      </tt><tt>    R_useDynamicSymbols(dll, FALSE);</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt><tt><br>
      </tt></p>
    <p>Do the functions have to be sequentially numbered (1,2,3...) in
      the R_CallMethodDef structure? And are there any additional
      procedures required when compiling the package using the latest
      version of Rcpp?</p>
    <p><br>
    </p>
    <p>Barth</p>
    <p><br>
    </p>
  </body>
</html>