Windows 7에서 R 2.15.1을 사용하고 있는데 다음 R 코드를 실행하면 오류 메시지가 나타납니다. 누구가 나를 도울까요?인라인 및 Rcpp 패키지의 오류
> library(inline)
>
> if(require(Rcpp)){
+ fx <- cxxfunction(signature(x = "integer", y = "numeric") , '
+ return wrap(as<int>(x) * as<double>(y)) ;
+ ', plugin = "Rcpp")
+ }
Loading required package: Rcpp
cygwin warning:
MS-DOS style path detected: C:/R/R-215~1.1/etc/i386/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/R/R-215~1.1/etc/i386/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Syntax error: "(" unexpected (expecting "fi")
make: *** [file11a82c84184d.dll] Error 2
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 file11a82c84184d(SEXP x, SEXP y) ;
24: }
25:
26: // definition
27:
28: SEXP file11a82c84184d(SEXP x, SEXP y){
29: BEGIN_RCPP
30:
31: return wrap(as<int>(x) * as<double>(y)) ;
32:
33: END_RCPP
34: }
35:
36:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! cygwin warning:
MS-DOS style path detected: C:/R/R-215~1.1/etc/i386/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/R/R-215~1.1/etc/i386/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Syntax error: "(" unexpected (expecting "fi")
make: *** [file11a82c84184d.dll] Error 2
In addition: Warning message:
running command 'C:/R/R-2.15.1/bin/i386/R CMD SHLIB file11a82c84184d.cpp 2> file11a82c84184d.cpp.err.txt' had status 1
>
아래의 Dirk의 답변 외에도 저자에게 문제가있는 곳에서이 게시물을 팔로우 할 수 있습니다. http://www.r-bloggers.com/installing-rcpp-on-windows-7-for-r-and-c-integration/ –
이것은 복잡한 게시물입니다. Windows 용 R 컴파일러 설치 방법은 수십 개의 자습서에서 설명합니다. 즉, Cygwin과 섞지 마십시오. –