Error from cppFunction(Rcpp) under R 15.2 Windows XP [duplicate]

£可爱£侵袭症+ 提交于 2020-01-05 08:22:31

问题


When I've called :

cppFunction('
  int add(int x, int y, int z) {
    int sum = x + y + z;
    return sum;
  }'
)

Error with below message occured, anyone have meet similar problem ? Any clues how to interprete this message ?

g

    ++  -I"D:/PROGRA~1/R/R-215~1.2/include" -DNDEBUG     -I"D:/Program Files/R/R-2.15.2/library/Rcpp/include"      -O2 -Wall  -mtune=core2 -c filed946a0620c7.cpp -o filed946a0620c7.o g++ -shared -s -static-libgcc -o sourceCpp_70998.dll tmp.def filed946a0620c7.o D:/Program Files/R/R-2.15.2/library/Rcpp/lib/i386/libRcpp.a -LD:/PROGRA~1/R/R-215~1.2/bin/i386 -lR g++.exe: error: D:/Program: No such file or directory g++.exe: error: Files/R/R-2.15.2/library/Rcpp/lib/i386/libRcpp.a: No such file or directory 
    Error in sourceCpp(code = code, env = env, rebuild = rebuild, showOutput = showOutput,  : 
  Error occurred building shared library.

回答1:


You installed R in a path with spaces. Which breaks things.

R defaults to this even though the R-on-Windows FAQ says not to do this.

The next Rcpp version has a defense against this. Until then, move your R installation.

Oh, and I answered this very question probably three times already on SO alone...



来源:https://stackoverflow.com/questions/15101667/error-from-cppfunctionrcpp-under-r-15-2-windows-xp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!