[R] Error in Rcpp/inline (Windows XP)

allenhahaha allenhahaha at gmail.com
Wed Oct 12 16:15:33 CEST 2011


Hi, everyone,

I am just trying to use Rcpp in my computer, and I would like to try a
simple example from website, but R keeps reporting me error. I am using
Windows XP, and has installed Rtools and GSI.

Here is the response: 

> src = '
+ Rcpp::NumericVector xa(a);
+ Rcpp::NumericVector xb(b);
+ int n_xa = xa.size();
+ int n_xb = xb.size();
+  
+ Rcpp::NumericVector xab(n_xa + n_xb - 1);
+ 
+ for (int i = 0; i < n_xa; i++)
+   for (int j = 0; j < n_xb; j++)
+     xab[i + j] += xa[i] * xb[j];
+  
+ return xab;
+ '
>  
> fun = cxxfunction(
+        signature(a = "numeric", b = "numeric"), 
+        src, plugin = "Rcpp",verbose=T)
 >> setting environment variables: 
PKG_LIBS =  C:/Program Files/R/R-2.13.0/library/Rcpp/lib/i386/libRcpp.a

 >> LinkingTo : Rcpp
CLINK_CPPFLAGS =  -I"C:/Program Files/R/R-2.13.0/library/Rcpp/include" 

 >> Program source :

 ......

Compilation argument:
 C:/PROGRA~1/R/R-213~1.0/bin/i386/R CMD SHLIB file6d55374d.cpp 2>
file6d55374d.cpp.err.txt 
g++ -I"C:/PROGRA~1/R/R-213~1.0/include"    -I"C:/Program
Files/R/R-2.13.0/library/Rcpp/include"      -O2 -Wall  -c file6d55374d.cpp
-o file6d55374d.o
g++ -shared -s -static-libgcc -o file6d55374d.dll tmp.def file6d55374d.o
C:/Program Files/R/R-2.13.0/library/Rcpp/lib/i386/libRcpp.a
-LC:/PROGRA~1/R/R-213~1.0/bin/i386 -lR
cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-213~1.0/etc/i386/Makeconf
  Preferred POSIX equivalent is:
/cygdrive/c/PROGRA~1/R/R-213~1.0/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
g++.exe: C:/Program: No such file or directory
g++.exe: Files/R/R-2.13.0/library/Rcpp/lib/i386/libRcpp.a: No such file or
directory

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

Program source:
......
Erreur dans compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-213~1.0/etc/i386/Makeconf
  Preferred POSIX equivalent is:
/cygdrive/c/PROGRA~1/R/R-213~1.0/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
g++.exe: C:/Program: No such file or directory
g++.exe: Files/R/R-2.13.0/library/Rcpp/lib/i386/libRcpp.a: No such file or
directory
>  
> fun(1:3, 1:4)

Also, here is a test by Romain that perhaps useful.

> system( "R CMD SHLIB test.c" ) 
cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-213~1.0/etc/i386/Makeconf
  Preferred POSIX equivalent is:
/cygdrive/c/PROGRA~1/R/R-213~1.0/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
gcc -I"C:/PROGRA~1/R/R-213~1.0/include"    -I"C:/Program
Files/R/R-2.13.0/library/Rcpp/include"      -O3 -Wall  -std=gnu99 -c test.c
-o test.o
gcc -shared -s -static-libgcc -o test.dll tmp.def test.o C:/Program
Files/R/R-2.13.0/library/Rcpp/lib/i386/libRcpp.a
-LC:/PROGRA~1/R/R-213~1.0/bin/i386 -lR
gcc.exe: C:/Program: No such file or directory
gcc.exe: Files/R/R-2.13.0/library/Rcpp/lib/i386/libRcpp.a: No such file or
directory
> dyn.load( "test.so" ) 
Erreur dans inDL(x, as.logical(local), as.logical(now), ...) : 
  impossible de charger l'objet partagé 'C:/Documents and Settings/kangj/Mes
documents/test.so':
  LoadLibrary failure:  Le module spécifié est introuvable.
alide.
> .Call( "f" ) 
Erreur dans .Call("f") : 
  point d'entrée C "f" absent de la table de chargement


Thanks so much.

Kent


--
View this message in context: http://r.789695.n4.nabble.com/Error-in-Rcpp-inline-Windows-XP-tp3898121p3898121.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list