Sorry, but that&#39;s just me being lazy with my lib directory.  When I start R back up in my example, you&#39;ll see it&#39;s 2.13.1.  <br><br><div class="gmail_quote">On Fri, Aug 12, 2011 at 6:07 AM, Dirk Eddelbuettel <span dir="ltr">&lt;<a href="mailto:edd@debian.org">edd@debian.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Hi Chris,<br>
<div><div></div><div class="h5"><br>
On 11 August 2011 at 22:23, Chris DuBois wrote:<br>
| Hi all,<br>
|<br>
| I&#39;ve created a package using Rcpp.package.skeleton(&quot;pkg&quot;,module=TRUE).  <br>
|<br>
| If I create a file R/hello_world2.R with the following<br>
|<br>
| show(World)<br>
| b &lt;- new(World)<br>
| b$greet()<br>
| b$set(&quot;hello everybody&quot;)<br>
| b$greet()<br>
| rm(b)<br>
|<br>
| then I receive an &quot;execution halted&quot; error when I try to compile the package<br>
| using R CMD INSTALL pkg.  Why is this?  <br>
|<br>
| I&#39;ve included my steps below.<br>
|<br>
| &gt; library(Rcpp)  # latest version from CRAN<br>
| &gt; Rcpp.package.skeleton(&quot;pkg&quot;,module=TRUE)<br>
| Creating directories ...<br>
| Creating DESCRIPTION ...<br>
| Creating NAMESPACE ...<br>
| Creating Read-and-delete-me ...<br>
| Saving functions and data ...<br>
| Making help files ...<br>
| Done.<br>
| Further steps are described in &#39;./pkg/Read-and-delete-me&#39;.<br>
|<br>
| Adding Rcpp settings<br>
|  &gt;&gt; added RcppModules: yada<br>
|  &gt;&gt; added Depends: Rcpp<br>
|  &gt;&gt; added LinkingTo: Rcpp<br>
|  &gt;&gt; added useDynLib directive to NAMESPACE<br>
|  &gt;&gt; added Makevars file with Rcpp settings<br>
|  &gt;&gt; added Makevars.win file with Rcpp settings<br>
|  &gt;&gt; added example header file using Rcpp classes<br>
|  &gt;&gt; added example src file using Rcpp classes<br>
|  &gt;&gt; added example R file calling the C++ example<br>
|  &gt;&gt; added Rd file for rcpp_hello_world<br>
|  &gt;&gt; copied the example module <br>
| &gt; q()<br>
| Save workspace image? [y/n/c]: n<br>
| chris@seldon:~/Documents/networkstats$ R CMD INSTALL pkg<br>
| * installing to library ‘/home/chris/R/i486-pc-linux-gnu-library/2.10’<br>
<br>
</div></div>Rcpp has dependended on R (&gt;= 2.12) for quite some time, and Module<br>
definitely requires it.<br>
<br>
How did you get Rcpp installed on that version of R, and what version of Rcpp<br>
is it?<br>
<br>
Something like the example you show here is part of the unit tests and<br>
clearly works with current R and Rcpp versions.  Can you get hold of a newer<br>
R somewhere to try it?<br>
<br>
Dirk<br>
<div><div></div><div class="h5"><br>
| * installing *source* package ‘pkg’ ...<br>
| ** libs<br>
| g++ -I/usr/share/R/include   -I&quot;/home/chris/R/i486-pc-linux-gnu-library/2.10/<br>
| Rcpp/include&quot;   -fpic  -O3 -pipe  -g -c rcpp_hello_world.cpp -o<br>
| rcpp_hello_world.o<br>
| g++ -I/usr/share/R/include   -I&quot;/home/chris/R/i486-pc-linux-gnu-library/2.10/<br>
| Rcpp/include&quot;   -fpic  -O3 -pipe  -g -c rcpp_module.cpp -o rcpp_module.o<br>
| g++ -shared -o pkg.so rcpp_hello_world.o rcpp_module.o -L/home/chris/R/<br>
| i486-pc-linux-gnu-library/2.10/Rcpp/lib -lRcpp -Wl,-rpath,/home/chris/R/<br>
| i486-pc-linux-gnu-library/2.10/Rcpp/lib -L/usr/lib/R/lib -lR<br>
| installing to /home/chris/R/i486-pc-linux-gnu-library/2.10/pkg/libs<br>
| ** R<br>
| ** preparing package for lazy loading<br>
| ** help<br>
| Warning: /home/chris/Documents/networkstats/pkg/man/pkg-package.Rd:32: All text<br>
| must be in a section<br>
| Warning: /home/chris/Documents/networkstats/pkg/man/pkg-package.Rd:33: All text<br>
| must be in a section<br>
| *** installing help indices<br>
| ** building package indices ...<br>
| ** testing if installed package can be loaded<br>
|<br>
| * DONE (pkg)<br>
| chris@seldon:~/Documents/networkstats$ R<br>
| R version 2.13.1 (2011-07-08)<br>
| &gt; library(pkg)<br>
| Loading required package: Rcpp<br>
| &gt; source(&quot;pkg/R/rcpp_hello_world.R&quot;)<br>
| &gt; rcpp_hello_world()  # works as expected<br>
| [[1]]<br>
| [1] &quot;foo&quot; &quot;bar&quot;<br>
|<br>
| [[2]]<br>
| [1] 0 1<br>
| &gt; q()<br>
| chris@seldon:~/Documents/networkstats$ cp rcpp_hello_world2.R pkg/R/<br>
| chris@seldon:~/Documents/networkstats$ R CMD INSTALL pkg<br>
| * installing to library ‘/home/chris/R/i486-pc-linux-gnu-library/2.10’<br>
| * installing *source* package ‘pkg’ ...<br>
| ** libs<br>
| make: Nothing to be done for `all&#39;.<br>
| installing to /home/chris/R/i486-pc-linux-gnu-library/2.10/pkg/libs<br>
| ** R<br>
| ** preparing package for lazy loading<br>
| Execution halted<br>
|<br>
|<br>
</div></div>| ----------------------------------------------------------------------<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>
<font color="#888888"><br>
--<br>
Two new Rcpp master classes for R and C++ integration scheduled for<br>
New York (Sep 24) and San Francisco (Oct 8), more details are at<br>
<a href="http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10" target="_blank">http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10</a><br>
<a href="http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php" target="_blank">http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php</a><br>
</font></blockquote></div><br>