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

前端 未结 3 1159
说谎
说谎 2020-12-18 09:22

I\'ve been trying to work with Rcpp in R 2.14.2 on a Windows XP platform. As far as I can tell, I followed all of the recommended steps for getting Rcpp to work:

相关标签:
3条回答
  • 2020-12-18 09:49

    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.

    0 讨论(0)
  • 2020-12-18 09:50

    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.

    0 讨论(0)
  • 2020-12-18 09:52

    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.

    0 讨论(0)
提交回复
热议问题