关于c ++:已安装Rcpp Rtools,但未找到错误消息g ++

Rcpp Rtools installed but error message g++ not found

我已经咨询了与我的特定问题相关的现有SO条目,但仍无法解决。

我正在尝试使用工作权限有限的机器在工作,但是我可以运行Rtools.exe,所以我安装了它。

我对R的设置是:

1
2
3
4
5
 platform       x86_64-w64-mingw32          
 arch           x86_64                      
 os             mingw32                    
 system         x86_64, mingw32            
 version.string R version 3.3.0 (2016-05-03)

我是RStudion版本0.99.902。我安装了Rtools版本3.3.0.1959。

所有R,Rstudio和Rtools都安装在C:/ WORK /中,在这里我具有一些有限的管理员权限。

在我的系统ENV变量中,我设置了:

1
2
3
4
 C:\\\\WORK\\\
tools\\\\bin; C:\\\\WORK\\\
tools\\\\gcc-  4.6.3\\\\bin; C:\\\\WORK\\\
-3.3.0\\\\bin\\\\x64;"

当我跑步

1
 system('where make')

我懂了

1
2
 C:\\WORK\
tools\\bin\\make.exe

当我跑步

1
 system('g++ -v')

我得到:

1
2
3
4
5
6
7
8
 Using built-in specs.
 COLLECT_GCC=C:\\WORK\
tools\\GCC-46~1.3\\bin\\G__~1.EXE
 COLLECT_LTO_WRAPPER=c:/WORK/rtools/gcc-46~1.3/bin/../libexec/gcc/i686-w64-   mingw32/4.6.3/lto-wrapper.exe
 Target: i686-w64-mingw32
 Configured with: /data/gannet/ripley/Sources/mingw-test3/src/gcc/configure --host=i686-w64-mingw32 --build=x86_64-linux-gnu --target=i686-w64-mingw32 --with-sysroot=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --prefix=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --with-gmp=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpfr=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpc=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --disable-shared --enable-static --enable-targets=all --enable-languages=c,c++,fortran --enable-libgomp --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-nls --disable-werror --enable-checking=release --disable-win32-registry --disable-rpath --disable-werror CFLAGS='-O2 -mtune=core2 -fomit-frame-pointer' LDFLAGS=
 Thread model: win32
 gcc version 4.6.3 20111208 (prerelease) (GCC)

编译时,出现以下错误:

1
2
3
 Error in compileCode(f, code, language = language, verbose = verbose) :
 Compilation ERROR, function(s)/method(s) not created!
 c:/Rtools/mingw_64/bin/g++: not found

我的问题是:为什么R还在寻找g ++

1
 c:/Rtools/mingw_64/bin/g++

我不是已经设定R在其中寻找

1
 C:/WORK/Rtools?

即使我手动添加

1
 c:/WORK/Rtools/mingw_64/bin/g++

在ENV变量中,我仍然遇到相同的错误。 (由于管理员权限,我无法在C:/中创建Rtools文件夹。)

有没有人遇到这个特定的问题?


路径c:/Rtools/mingw_64/bin/作为变量BINPREF的值被硬编码到R安装中某处的文件Makeconf(在我的情况下为C:\\Progs\
\
-3.4.1\\etc\\x64
)中。

最简单的方法是将此路径更改为您的路径C:/WORK/Rtools/bin(在我的情况下是C:/Progs/RTools/3.4/mingw_64/bin/)。在新安装的R-3.4.1和Rtools3.4以及一个最小的示例中,这对我有用。


发生的是对于R 3.3.x,需要安装在RTools 34而非NOT 33上。

删除rtools安装,然后按照以下指南进行操作:

http://thecoatlessprofessor.com/programming/rcpp/install-rtools-for-rcpp/

@David,您需要删除所有C:\\WORK\
tools\\
实例和所有重复项(例如C:\\WORK\
-3.3.0\\bin\\x64
出现两次)。然后添加:

c:\\WORK\
tools\\bin;
c:\\WORK\
tools\\mingw_32\\bin;


一种可行且简单的方法是在以下提示中选择"完整安装以构建32或64位"。enter image description here


我在使用RStudio 1.3+和RTools 4.0的Windows 10上遇到了相同的问题。在安装RTools并尝试安装另一个软件包(需要RTools)之后,它不断抛出错误

c:/rtools40/mingw32/bin/g++: No such file or directory

它一直在Windows上选择错误的RTools安装路径。重新启动RStudio后,它选择了正确的路径:

C:\
BuildTools\\4.0\\mingw32\\bin