Windows上的Rcpp编译失败(64位)

时间:2014-03-25 10:34:36

标签: r rcpp

我正在尝试在我的Windows机器上设置Rcpp(我的unix机箱上没有问题)。

我在C中安装了R:/ opt / R / current(Google搜索建议安装路径中的空格可能会出错),我已经安装了Rtools。 我有简单的cpp文件:

#include <Rcpp.h>
using namespace Rcpp;

// [[Rcpp::export]]
int timesTwo(int x) {
   return x * 2;
}

和一个R档案:

library(Rcpp)
sourceCpp("cppfile.cpp")

我收到以下错误:

C:/opt/R/current/etc/x64/Makeconf:196: warning: overriding recipe for target `.m.o' C:/opt/R/current/etc/x64/Makeconf:189: warning: ignoring old recipe for target `.m.o' C:\MINGW3~1\bin\make.exe: Interrupt/Exception caught (code = 0xc0000005, addr = 0x0x750343f9) Warning message: running command 'make -f "C:/opt/R/current/etc/x64/Makeconf" -f "C:/opt/R/current/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_67515.dll" WIN=64 TCLBIN=64 OBJECTS="cppfile.o"' had status 255  
Error in sourceCpp("cppfile.cpp") : 
  Error 1 occurred building shared library.

任何帮助都将不胜感激。

PS:安装,例如来自github dplyr的{​​{1}}工作正常(并且做了很多编译Rcpp的东西)。

UPDATE :我将Rtools bin目录添加到PATH,现在我收到另一个似乎与32 / 64bit相关的错误:

devtools

1 个答案:

答案 0 :(得分:0)

原来我需要将RTools / bin和Rtools / gcc-x.y.z / bin添加到PATH。现在情况很顺利。

相关问题