[Rcpp-devel] Problem installing even default Rcpp skeleton package
Dirk Eddelbuettel
edd at debian.org
Thu May 10 02:07:06 CEST 2012
On 9 May 2012 at 19:40, Steve Lianoglou wrote:
| Hi,
|
| On Wed, May 9, 2012 at 7:31 PM, Nick Matzke <matzke at berkeley.edu> wrote:
| [snip]
| > So, next issue. My default "RcppSkeleton" package now installs fine and
| > library(RcppSkeleton) works fine.
| >
| > However, when I run the one function in the package, rcpp_hello_world(), I
| > get this problem:
| >
| >
| >> rcpp_hello_world()
| >
| > Error in .Call("rcpp_hello_world", PACKAGE = "hello_world_Rcpp") :
| > C symbol name "rcpp_hello_world" not in DLL for package "hello_world_Rcpp"
|
| Your package is called "RcppSkeleton", isn't it? If so, that should be
| reflected in your PACKAGE argument in .Call, eg:
|
| .Call("rcpp_hello_world", PACKAGE="RcppSkeleton")
+1
And that is what should have gotten filled in as rcpp_hello_world.R in
inst/skeleton/ (which gets copied) has:
rcpp_hello_world <- function(){
.Call( "rcpp_hello_world", PACKAGE = "@PKG@" )
}
and all that works here:
R> Rcpp.package.skeleton("rcppSkeletonTest", path="/tmp")
Creating directories ...
Creating DESCRIPTION ...
Creating NAMESPACE ...
Creating Read-and-delete-me ...
Saving functions and data ...
Making help files ...
Done.
Further steps are described in '/tmp/rcppSkeletonTest/Read-and-delete-me'.
Adding Rcpp settings
>> added Depends: Rcpp
>> added LinkingTo: Rcpp
>> added useDynLib directive to NAMESPACE
>> added Makevars file with Rcpp settings
>> added Makevars.win file with Rcpp settings
>> added example header file using Rcpp classes
>> added example src file using Rcpp classes
>> added example R file calling the C++ example
>> added Rd file for rcpp_hello_world
R> library(rcppSkeletonTest) ## after R CMD INSTALL ... outside of R
R> rcpp_hello_world()
[[1]]
[1] "foo" "bar"
[[2]]
[1] 0 1
R> rcppSkeletonTest::rcpp_hello_world()
[[1]]
[1] "foo" "bar"
[[2]]
[1] 0 1
R>
Ok?
Dirk
--
R/Finance 2012 Conference on May 11 and 12, 2012 at UIC in Chicago, IL
See agenda, registration details and more at http://www.RinFinance.com
More information about the Rcpp-devel
mailing list