我运行的结果如下:
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 file3bfc83e( SEXP n_, SEXP width_, SEXP format_) ;
24: }
25:
26: // definition
27:
28: SEXP file3bfc83e( SEXP n_, SEXP width_, SEXP format_ ){
29: BEGIN_RCPP
30:
31:
32: int n = as(n_) ;
33: int width = as( width_ ) ;
34: const char* format = as( format_ ) ;
35:
36: std::string buffer( width, '0' ) ;
37: std::vector< std::string > elements( n ) ;
38: for( int i=0; i( buffer.data() ),
39: format,
40: i+1
41: ) ;
42: elements = buffer.c_str() ;
43: }
44:
45: std::stringstream ss ;
46:
47:
48: CharacterVector res( n*(n-1)/2) ;
49: for( int i=0, k=0; i<n-1; i++){
50: for( int j=i+1; j<n; j++, k++){
51: ss << "i" << elements << "." << elements[j] ;
52: res[k] = ss.str() ;
53: ss.str("") ;
54: }
55: }
56:
57: return res ;
58:
59: END_RCPP
60: }
61:
62:
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-213~1.1/bin/i386/R CMD SHLIB file3bfc83e.cpp 2> file3bfc83e.cpp.err.txt' had status 1
>