How to get Rcpp to work in R on a Windows XP platform?

我怕爱的太早我们不能终老 提交于 2019-11-29 07:59:36

Do not install R in a directory containing a space in the path name. That recommendation is, as I recall, in the 'R for Windows FAQ'.

My personally preference is always c:\opt\R-current\ instead of the versioned default path.

The error is explained in the last 5 lines of the message you posted:

g++.exe: error: C:/Documents: No such file or directory
g++.exe: error: and: No such file or directory
g++.exe: error: Settings/dv6110ca/My: No such file or directory
g++.exe: error: Documents/R/win-library/2.14/Rcpp/lib/i386/libRcpp.a: No such file or  
directory

g++.exe is looking for a file called libRcpp.a but the file is in a folder with spaces in its name, in particular in your computer the file is in this folder:

C:/Documents and Settings/dv6110ca/My Documents/R/win-library/2.14/Rcpp/lib/i386/libRcpp.a

and the path to the folder contains 3 spaces (between Documents and and, between and and Settings, between My and Documents). In some way your compiler/linker does not like that spaces.

I was having the same problem setting up Rcpp. It looks like you uninstalled R and then re-installed it to create a set up compatible with Rcpp. When you do this, R will install packages in the same folder as the previous installs. After uninstalling R, make sure that you delete the folder that holds the packages. On my windows 7 machine, this was folder was located in C:/Users/Chandler/R. Delete this folder; then re-install R. Make sure that new packages are installed in your new R folder, e.g. C:\R\R-2.14.2\library. This should eliminate the problem with spaces in folder locations that Dirk mentioned above.

Also, make sure the path is the same as the example in the "R Installation and Administration" manual appendix D. It will easiest to follow this manual if you are using the most current version of R instead of 2.14.2

Note: I still get the cygwin warning even though Rcpp works.

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