I had the same problem before I realized that when a Module is loaded as part of a package (instead of manually loading the shared lib) you don&#39;t need the whole <font face="arial, sans-serif"><br>&gt; </font><font><font face="arial, sans-serif"><span style="border-collapse: collapse;">Module(&#39;yada&#39;,&#39;test&#39;)$ ...<br>

just try <br>&gt;bla()<br><br>The exposed classes and functions are automatically made available in the namespace of the package<br></span></font></font><font><font face="arial, sans-serif"><span style="border-collapse:collapse"></span></font></font><br>

<font><font face="arial, sans-serif"><span style="border-collapse:collapse">&gt; library(test)<br>Loading required package: Rcpp<br>&gt; test::<br>test::bar               test::bla2              test::rcpp_hello_world<br>

test::bla               test::foo               test::World<br>test::bla1              test::hello             <br><br>Regards,<br>Jonas<br><br><br><br></span></font></font><br><div class="gmail_quote">On Wed, Jun 22, 2011 at 12:51 AM, Andrew Redd <span dir="ltr">&lt;<a href="mailto:amredd@gmail.com">amredd@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I apologize if this has been covered.  I&#39;ve looked and see a couple of post relating to this issue, but I&#39;m not sure if it was ever solved. The example modules appear to not work, at least for me.  On a related note I can&#39;t get my modules to run either, but If I can figure out how to run the examples I think I can get mine running.<div>


<br></div><div>R&gt; sessionInfo()<div>R version 2.13.0 (2011-04-13)</div><div>Platform: x86_64-pc-linux-gnu (64-bit)</div><div><br></div><div>locale:</div><div> [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              </div>


<div> [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    </div><div> [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   </div><div> [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 </div><div> [9] LC_ADDRESS=C               LC_TELEPHONE=C            </div>


<div>[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       </div><div><br></div><div>attached base packages:</div><div>[1] stats     graphics  grDevices utils     datasets  methods   base     </div><div><br></div><div>


other attached packages:</div><div>[1] Rcpp_0.9.4</div><div><div><br></div></div></div><div>To install the package skeleton:</div><div>$ r -lRcpp -e&quot;Rcpp.package.skeleton(\&quot;test\&quot;,module=T)&quot;</div><div>


Attaching package: &#39;utils&#39;</div><div><br></div><div>The following object(s) are masked from &#39;package:Rcpp&#39;:</div><div><br></div><div>    .DollarNames, prompt</div><div><br></div><div>Creating directories ...</div>


<div>Creating DESCRIPTION ...</div><div>Creating NAMESPACE ...</div><div>Creating Read-and-delete-me ...</div><div>Saving functions and data ...</div><div>Making help files ...</div><div>Done.</div><div>Further steps are described in &#39;./test/Read-and-delete-me&#39;.</div>


<div><br></div><div>Adding Rcpp settings</div><div> &gt;&gt; added RcppModules: yada</div><div> &gt;&gt; added Depends: Rcpp</div><div> &gt;&gt; added LinkingTo: Rcpp</div><div> &gt;&gt; added useDynLib directive to NAMESPACE</div>


<div> &gt;&gt; added Makevars file with Rcpp settings</div><div> &gt;&gt; added Makevars.win file with Rcpp settings</div><div> &gt;&gt; added example header file using Rcpp classes</div><div> &gt;&gt; added example src file using Rcpp classes</div>


<div> &gt;&gt; added example R file calling the C++ example</div><div> &gt;&gt; added Rd file for rcpp_hello_world</div><div> &gt;&gt; copied the example module </div><div><br></div><div>build</div><div>$ R CMD build test</div>


<div>&lt;&lt;output omitted&gt;&gt;</div><div><br></div><div>and check with an error.</div><div>$R CMD check test_1.0.tar.gz</div><div><div>&lt;&lt;output omitted&gt;&gt;</div></div><div><div>* checking whether the name space can be loaded with stated dependencies ... WARNING</div>


<div>Error: .onLoad failed in loadNamespace() for &#39;test&#39;, details:</div><div>  call: value[[3L]](cond)</div><div>  error: failed to load module yada from package test</div><div>Execution halted</div></div><div><br>


</div><div>&lt;&lt;output omitted&gt;&gt;</div><div><br></div><div>According to Dirk&#39;s June 15th post on the issue I include <span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">require(&quot;methods&quot;, character=TRUE, quietly=TRUE) in the .onLoad function, now checks ok but when trying things out I get a segmentation fault.</span></div>


<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">$ R -q --vanilla</span></div><div><font face="arial, sans-serif"><div><span style="border-collapse:collapse">R&gt; library(test)</span></div>


<div><span style="border-collapse:collapse">Loading required package: Rcpp</span></div><div><span style="border-collapse:collapse">R&gt; Module(&#39;yada&#39;,&#39;test&#39;)$bla()</span></div>
<div><span style="border-collapse:collapse"><br></span></div><div><span style="border-collapse:collapse"> *** caught segfault ***</span></div><div><span style="border-collapse:collapse">address 0x90, cause &#39;memory not mapped&#39;</span></div>


<div><span style="border-collapse:collapse"><br></span></div><div><span style="border-collapse:collapse">Traceback:</span></div><div><span style="border-collapse:collapse"> 1: .Call(symbol)</span></div>
<div><span style="border-collapse:collapse"> 2: Module(module, mustStart = TRUE)</span></div><div><span style="border-collapse:collapse"> 3: .getModulePointer(x)</span></div>
<div><span style="border-collapse:collapse"> 4: Module(&quot;yada&quot;, &quot;test&quot;)$bla</span></div><div><span style="border-collapse:collapse"><br></span></div>
<div><span style="border-collapse:collapse">Possible actions:</span></div><div><span style="border-collapse:collapse">1: abort (with core dump, if enabled)</span></div>
<div><span style="border-collapse:collapse">2: normal R exit</span></div><div><span style="border-collapse:collapse">3: exit R without saving workspace</span></div><div>
<span style="border-collapse:collapse">4: exit R saving workspace</span></div><div><span style="border-collapse:collapse">Selection: </span></div><div style="border-collapse:collapse">
<br></div></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">So questions are:</span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">    1) is anyone else getting this error?</span></font></div>


<div><font face="arial, sans-serif"><span style="border-collapse:collapse">    2) does anyone know how to fix it?</span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br>
</span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">Thanks,</span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">Andrew</span></font></div>

<font color="#888888">
<div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div>
</font><br>_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
<br></blockquote></div><br>