在RInside中使用null环境是无效的错误

use of null environment is defunct error in RInside

本文关键字:无效 错误 环境 null RInside      更新时间:2023-10-16

我正在处理Ubuntu上的RInside。我已经安装了R, Rcpp和RInside。我成功地构建了我的c++代码,但是当我运行我的程序时,我得到了下一个错误:"使用null环境是无效的"在第一行RInside R(argc, argv)

更奇怪的是,在一台机器上运行得很好,但是当我试图在另一台机器上运行相同的代码时,我得到了一个错误。

在互联网上,我发现了下一个短语:"从2.4.0版本开始,使用NULL作为环境是不存在的"。因此,R、Rcpp和RInside似乎没有兼容的版本。它可以很好地与R v2.15.1和RInside v0.2.11一起工作,但不能与R v3.0.3 Rcpp v0.11 RInside v0.2.11一起工作。是否有此库的兼容版本列表?或者可能有其他原因导致这个错误。

每个时间点的CRAN版本应该是当前的。

使用RInside版本对应于同一时间的匹配Rcpp版本——即当前版本。

也进入examples/standard目录的RInside,并说'make',这应该创建十几个工作示例。这里我只构建第一个:

edd@max:~/git/rinside/inst/examples/standard$ make  rinside_sample0 
g++-4.8 -I/usr/share/R/include -I/usr/local/lib/R/site-library/Rcpp/include 
-I/usr/local/lib/R/site-library/RInside/include -g -O3 -Wall -pipe 
-Wno-unused -pedantic -Wall    rinside_sample0.cpp  -L/usr/lib/R/lib 
-lR  -lblas -llapack  -L/usr/local/lib/R/site-library/RInside/lib 
-lRInside -Wl,-rpath,/usr/local/lib/R/site-library/RInside/lib -o rinside_sample0
edd@max:~/git/rinside/inst/examples/standard$ ./rinside_sample0 
Hello, world!
edd@max:~/git/rinside/inst/examples/standard$