Skip to content

Error in Rcpp/inline (Windows XP)

2 messages · allenhahaha, Brian Ripley

#
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:
+ 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;
+ '
+        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
Also, here is a test by Romain that perhaps useful.
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
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.
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.
#
Did you read the posting guide (it says R-help is not for questions 
about compiled code)?

Or the rw-FAQ (it warned you that lots of contributed packages did not 
take account of spaces in path names, so suggested you install R in a 
path without one)?

This is a bug in one of the packages you are using, so you could 
(following the posting guide) discuss it with the package maintainers. 
But it is so common that you would do well to take the defensive 
action recommended in the rw-FAQ.
On Wed, 12 Oct 2011, allenhahaha wrote: