使用Sugar语法的Rcpp编译错误

时间:2013-09-17 14:42:39

标签: r rcpp

我试图使用一些Rcpp糖示例,但它无法正确编译并给我以下错误:

> cxxfunction(signature(),
+                      'NumericVector x = NumericVector::create(1,2,3,7,8,9);
+                      return all(x == 1);',
+                      plugin = "Rcpp")

ERROR(s) during compilation: source code errors or compiler configuration errors!

Program source:
  1: 
  2: // includes from the plugin
  3: 
  4: #include <Rcpp.h>
  5: 
  6: 
  7: #ifndef BEGIN_RCPP
  8: #define BEGIN_RCPP
  9: #endif
 10: 
 11: #ifndef END_RCPP
 12: #define END_RCPP
 13: #endif
 14: 
 15: using namespace Rcpp;
 16: 
 17: 
 18: // user includes
 19: 
 20: 
 21: // declarations
 22: extern "C" {
 23: SEXP file1d6c78f174e3( ) ;
 24: }
 25: 
 26: // definition
 27: 
 28: SEXP file1d6c78f174e3(  ){
 29: BEGIN_RCPP
 30: NumericVector x = NumericVector::create(1,2,3,7,8,9);
 31:                      return all(x == 1);
 32: END_RCPP
 33: }
 34: 
 35: 
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! 
In addition: Warning message:
running command 'C:/PROGRA~1/R/R-30~1.1/bin/x64/R CMD SHLIB file1d6c78f174e3.cpp 2> file1d6c78f174e3.cpp.err.txt' had status 1 

这是我的会话信息:

> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] inline_0.3.13     Rcpp_0.10.4       data.table_1.8.10

loaded via a namespace (and not attached):
[1] tools_3.0.1

0 个答案:

没有答案