2013-10-14 21 views
2

我正在嘗試構建一個用戶包,該包已經在我的安裝了R 2.15.1的同事的窗口框中生成。我的配置是:RcppArmadillo「ReferenceInputParameter不是模板」

[R 2.15.3,RTools 3.0,RCPP 0.10.4,RcppArmadillo 0.3.920.1,RStudio 0.97.551

這是第一次編譯實例時,我跑 「R CMD INSTALL mypackage的」。 indfunForecast.cpp是包中的源文件之一。

>g++ -m32 -I"D:/PROGRA~1/R/R-215~1.3/include" -DNDEBUG 
-I"D:/R/win-library/2.15/Rcpp/include" -I"D:/R/win-library/2.15/RcppArmadillo/include" 
-I"d:/RCompile/CRANpkg/extralibs64/local/include" 
-O2 -Wall -mtune=core2 
-c indfunForecast.cpp -o indfunForecast.o 

下面的錯誤消息:

In file included from D:/R/win-library/2.15/RcppArmadillo/include/RcppArmadillo.h:30:0, 
      from indfunForecast.cpp:16: 
D:/R/win-library/2.15/RcppArmadillo/include/RcppArmadilloForward.h:99:33: 
error: 'ConstReferenceInputParameter' is not a template 
D:/R/win-library/2.15/RcppArmadillo/include/RcppArmadilloForward.h:100:33: 
error: 'ReferenceInputParameter' is not a template 
D:/R/win-library/2.15/RcppArmadillo/include/RcppArmadilloForward.h:101:33: 
error: 'ConstInputParameter' is not a template 

任何想法是怎麼回事???

感謝您的幫助。 Sachko

回答

2

你有最新的RcppArmadillo需要最新的Rcpp,你沒有(我不會讓你知道細節,但它是CRAN相關的)。

從源代碼安裝Rcpp 0.10.5,事情應該可以工作。

+0

我也想知道userX是否需要更新R來匹配RTools。 –

+0

也許描述中的R級保護是不夠的,我們應該有代碼來聲明Rcpp的版本在RcppArmadillo頭文件中足夠高。 –

+1

描述通常就足夠了 - 在這裏我沒有更新它,因爲我在一個綁定的提交中共同上傳了兩個包,確保它們都能進入到CRAN。但直到本週,我才知道Rcpp僅在Windows上保留它的舊R發行版本。所以從這個意義上說,我的錯誤是不要求在RcppArmadillo的描述中使用正確的Rcpp,但它「僅」會影響Windows根據Uwe的選擇,如果以前的R版本失敗則不會生成。 –