[英]Rcpp reports an error: C symbol name “sourceCppContext” not in DLL for package “Rcpp”
I am trying Rcpp 0.10.0 on Mac OS 10.8.2, and use the example here about estimating \\pi. 我正在Mac OS 10.8.2上尝试Rcpp 0.10.0,并在此处使用有关估算\\ pi的示例。 However, when I run the following code in R:
但是,当我在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.
我再次检查了piSuger.cpp文件在当前目录中。 Thanks!
谢谢!
I suspect you are calling an older Rcpp version. 我怀疑您正在调用较旧的Rcpp版本。 Maybe you have several in your
.libPaths()
? 也许您的
.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: 一切都在这里
piBySimulation.r
是我在一两个小时前在博客中发布的示例,您尝试在此处复制:
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$
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.