| 所在主题: | |
| 文件名: rcpp.txt | |
| 资料下载链接地址: https://bbs.pinggu.org/a-996486.html | |
| 附件大小: | |
|
我按照一个网上的案例来做的,结果总是提示错误。好像在编译器上,我用的编译器是vc6.0,在windows 7下运行。请大家运行下附件中的代码,帮我看看问题处在哪里了。
我运行的结果如下: 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 > |
|
熟悉论坛请点击新手指南
|
|
| 下载说明 | |
|
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。 2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。 3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。 (如有侵权,欢迎举报) |
|
京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明