I am trying Rcpp 0.10.0 on Mac OS 10.8.2, and use the example here about estimating \\pi. However, when I run the following code in R:
sourceCpp("piSugar.cpp")
an error message says:
Error in .Call("sourceCppContext", PACKAGE = "Rcpp", file, code, .Platform) : C symbol name "sourceCppContext" not in DLL for package "Rcpp"
Did I miss something? I double checked that the piSuger.cpp file is in current directory. Thanks!
I suspect you are calling an older Rcpp version. Maybe you have several in your .libPaths()
? Or maybe you didn't restart your session?
It all works here -- and piBySimulation.r
is the example from my blog post from an hour or two ago which you are trying to replicate here:
edd@max:~/svn/rcpp/pkg/Rcpp/inst/examples/Misc$ Rscript piBySimulation.r
test replications elapsed relative
2 piSugar(N) 100 5.639 1.000
1 piR(N) 100 11.147 1.977
edd@max:~/svn/rcpp/pkg/Rcpp/inst/examples/Misc$
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.