Hello, <br><br>I'm trying to get Rcpp to work on my machine running Windows 7 64 bit but I'm not having much luck!<br><br>I've reinstalled R in: C:\opt\R-2.13.1<br>and have: C:\Rtools\MinGW64<br>my path variables are set as: C:\Rtools\bin;C:\Rtools\perl\bin;C:\Rtools\MinGW64\bin;C:\opt\R-2.13.1\bin\x64;C:\Program Files\Java\jdk1.6.0_25\bin;C:\Program Files\TortoiseSVN\bin;%JAVA_HOME%\bin;%MAVEN_HOME%\bin<br>
<br>Trying some examples from the help pdf I get the following error, can anyone help?<br><br>> library(inline)<br>
> library(Rcpp)<br>> src <- '<br>+ Rcpp::NumericVectorxa(a);<br>+ Rcpp::NumericVectorxb(b);<br>+ intn_xa=xa.size(),n_xb=xb.size();<br>+ <br>+ Rcpp::NumericVectorxab(n_xa+n_xb-1);<br>+ for(inti=0;i<n_xa;i++)<br>
+ for(intj=0;j<n_xb;j++)<br>+ xab[i+j]+=xa[i]*xb[j];<br>+ returnxab;<br>+ '<br>> fun <- cxxfunction(signature(a = "numeric", b = "numeric"), src, plugin = "Rcpp")<br>
cygwin warning:<br> MS-DOS style path detected: C:/opt/R-213~1.1/etc/x64/Makeconf<br> Preferred POSIX equivalent is: /cygdrive/c/opt/R-213~1.1/etc/x64/Makeconf<br> CYGWIN environment variable option "nodosfilewarning" turns off this warning.<br>
Consult the user's guide for more details about POSIX paths:<br> <a href="http://cygwin.com/cygwin-ug-net/using.html#using-pathnames" target="_blank">http://cygwin.com/cygwin-ug-net/using.html#using-pathnames</a><br>
file788a7664.cpp: In function 'SEXPREC* file788a7664(SEXPREC*, SEXPREC*)':<br>
file788a7664.cpp:31:1: error: 'NumericVectorxa' is not a member of 'Rcpp'<br>file788a7664.cpp:32:1: error: 'NumericVectorxb' is not a member of 'Rcpp'<br>file788a7664.cpp:33:1: error: 'intn_xa' was not declared in this scope<br>
file788a7664.cpp:33:9: error: 'xa' was not declared in this scope<br>file788a7664.cpp:33:19: error: 'n_xb' was not declared in this scope<br>file788a7664.cpp:33:24: error: 'xb' was not declared in this scope<br>
file788a7664.cpp:35:1: error: 'NumericVectorxab' is not a member of 'Rcpp'<br>file788a7664.cpp:35:24: error: 'n_xa' was not declared in this scope<br>file788a7664.cpp:36:5: error: 'inti' was not declared in this scope<br>
file788a7664.cpp:36:12: error: 'i' was not declared in this scope<br>file788a7664.cpp:37:6: error: 'intj' was not declared in this scope<br>file788a7664.cpp:37:13: error: 'j' was not declared in this scope<br>
file788a7664.cpp:38:3: error: 'xab' was not declared in this scope<br>file788a7664.cpp:39:1: error: 'returnxab' was not declared in this scope<br>make: *** [file788a7664.o] Error 1<br><br>ERROR(s) during compilation: source code errors or compiler configuration errors!<br>
<br>Program source:<br> 1: <br> 2: // includes from the plugin<br> 3: <br> 4: #include <Rcpp.h><br> 5: <br> 6: <br> 7: #ifndef BEGIN_RCPP<br> 8: #define BEGIN_RCPP<br> 9: #endif<br> 10: <br> 11: #ifndef END_RCPP<br>
12: #define END_RCPP<br> 13: #endif<br> 14: <br> 15: using namespace Rcpp;<br> 16: <br> 17: <br> 18: // user includes<br> 19: <br> 20: <br> 21: // declarations<br> 22: extern "C" {<br> 23: SEXP file788a7664( SEXP a, SEXP b) ;<br>
24: }<br> 25: <br> 26: // definition<br> 27: <br> 28: SEXP file788a7664( SEXP a, SEXP b ){<br> 29: BEGIN_RCPP<br> 30: <br> 31: Rcpp::NumericVectorxa(a);<br> 32: Rcpp::NumericVectorxb(b);<br> 33: intn_xa=xa.size(),n_xb=xb.size();<br>
34: <br> 35: Rcpp::NumericVectorxab(n_xa+n_xb-1);<br> 36: for(inti=0;i<n_xa;i++)<br> 37: for(intj=0;j<n_xb;j++)<br> 38: xab[i+j]+=xa[i]*xb[j];<br> 39: returnxab;<br> 40: <br> 41: END_RCPP<br> 42: }<br>
43: <br>
44: <br>Error in compileCode(f, code, language = language, verbose = verbose) : <br> Compilation ERROR, function(s)/method(s) not created! cygwin warning:<br> MS-DOS style path detected: C:/opt/R-213~1.1/etc/x64/Makeconf<br>
Preferred POSIX equivalent is: /cygdrive/c/opt/R-213~1.1/etc/x64/Makeconf<br> CYGWIN environment variable option "nodosfilewarning" turns off this warning.<br> Consult the user's guide for more details about POSIX paths:<br>
<a href="http://cygwin.com/cygwin-ug-net/using.html#using-pathnames" target="_blank">http://cygwin.com/cygwin-ug-net/using.html#using-pathnames</a><br>file788a7664.cpp: In function 'SEXPREC* file788a7664(SEXPREC*, SEXPREC*)':<br>
file788a7664.cpp:31:1: error: 'NumericVectorxa' is not a member of 'Rcpp'<br>file788a7664.cpp:32:1: error: 'NumericVectorxb' is not a member of 'Rcpp'<br>file788a7664.cpp:33:1: error: 'intn_xa' was not declared in this scope<br>
file788a7664.cpp:33:9: error: 'xa' was not declared in this scope<br>file788a7664.cpp:33:19: error: 'n_xb' was not declared in this scope<br>file788a7664.cpp:33:24: error: 'xb' was not declared in this scope<br>
file788a7664.cpp:35:1: error: 'NumericVectorxab' is not a member of 'Rcpp'<br>fil<br>In addition: Warning message:<br>running command 'C:/opt/R-2.13.1/bin/x64/R CMD SHLIB file788a7664.cpp 2> file788a7664.cpp.err.txt' had status 1 <br>