<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:14pt">Hello,<br>I have a code looking like this :<br><br>#include <RcppArmadillo.h><br>// [[Rcpp::depends(RcppArmadillo)]]<br>using namespace Rcpp;<br><br>// [[Rcpp::export]]<br>void func1(arma::mat& a) {<br><span class="tab">    ....</span><br>}<br>this compiles and executes fine when used with sourceCpp().<br><br>Then I include this code in a package, I call compileAttributes(), then I build and install my package and all that works fine.<br>Then, in R :<br><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: 2; text-align: -webkit-left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2;
 word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(225, 226, 229); "><pre tabindex="0" class="GNVMTOMCABB" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline-style: none; outline-width: initial; outline-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; white-space: pre-wrap !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; -webkit-user-select: text; line-height: 1.2; "><span class="GNVMTOMCHAB ace_keyword" style="color: blue; ">a=matrix(c(0,1,1,0),</span><span class="GNVMTOMCHAB ace_keyword" style="color: blue; ">ncol=2,byrow=TRUE)<br>func1(a)<br>does not work and I receive the message<br></span><span
 class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: 2; text-align: -webkit-left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(225, 226, 229); "><pre tabindex="0" class="GNVMTOMCABB" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline-style: none; outline-width: initial; outline-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; white-space: pre-wrap !important; margin-top: 0px;
 margin-right: 0px; margin-bottom: 0px; margin-left: 0px; -webkit-user-select: text; line-height: 1.2; "><span class="GNVMTOMCLAB  ace_constant" style="color: rgb(197, 6, 11); ">Error in .Call("pkgname_func1", PACKAGE = "pkgname", a,  : 
  "</span><span class="GNVMTOMCLAB  ace_constant" style="color: rgb(197, 6, 11); ">pkgname_func1</span><span class="GNVMTOMCLAB  ace_constant" style="color: rgb(197, 6, 11); "></span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: 2; text-align: -webkit-left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(225, 226, 229); "></span><span class="GNVMTOMCLAB  ace_constant" style="color: rgb(197, 6, 11); "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida
 Console'; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: 2; text-align: -webkit-left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(225, 226, 229); "></span>" not available for .Call() for package "pkgname"<br><br><br>If I put SEXP instead of arma::mat& as a parameter type in the exported function, all work fine.<br><br>Have I missed something for that to work with sourceCpp() and fail when within a package?<br><br>Thanks a lot<br>Riadh<br></span></pre></span><br></pre></span><br><div><br></div></div></body></html>