0

我已经使用 RcppArmadillo 和内联包编写了函数,我使用的是 Windows 7,安装了 R-2.14.1 和 Rtools215 并检查了路径。

funs = cxxfunction(list(MHcpp = signature(…), IWcpp = signature(…),  c(code1,code2), 
plugin="RcppArmadillo" ) # No compline and I they work fine as expected.

Package.skeleton(“new”,funs) # to create the package skeleton and the dynamic libray
# to build the package  I use
R CMD INSTALL –build new # I get the following error
C:/Users/samuel/Documents/R/win-library/2.14/Rcpp/lib/i386/libRcpp.a(Dimension.o
):Dimension.cpp:(.text+0x342): undefined reference to `_Unwind_SjLj_Unregister'
…………………………………………………………..
…………………………………………………………….
C:/Users/samuel/Documents/R/win-library/2.14/Rcpp/lib/i386/libRcpp.a(Environment
.o):Environment.cpp:(.text$_ZN4Rcpp11no_such_envC1Ei[Rcpp::no_such_env::no_such_
env(int)]+0x3fc): undefined reference to `_Unwind_SjLj_Unregister'
C:/Users/samuel/Documents/R/win-library/2.14/Rcpp/lib/i386/libRcpp.a(Environment
.o):Environment.cpp:(.text$_ZN4Rcpp11no_such_envC1Ei[Rcpp::no_such_env::no_such_
env(int)]+0x644): undefined reference to `_Unwind_SjLj_Resume'
collect2: ld returned 1 exit status
ERROR: compilation failed for package 'new'
* removing 'C:/Users/samuel/Documents/R/win-library/2.14/new'

关于如何解决问题的任何建议。

4

1 回答 1

2

您需要使用package.skeletonRcpp 提供的变体,或者在本例中为 RcppArmadillo。也就是说,调用

 RcppArmadillo.package.skeleton(...)

不是来自基础 R 的那个。

您还可以查看依赖于 RcppArmadillo 的其他 CRAN 包的组织方式并比较差异。

于 2012-03-06T15:54:37.937 回答