首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Rcpp Rtools已安装,但错误消息g++ not found

Rcpp Rtools已安装,但错误消息g++ not found
EN

Stack Overflow用户
提问于 2016-08-23 09:27:07
回答 5查看 10.2K关注 0票数 14

我已经查阅了与我的特定问题相关的现有条目,但仍然无法解决它。

我试图在我工作的机器上这样做,我有有限的管理员权限,但我可以运行Rtools.exe,所以我安装了它。

我对R的设置是:

代码语言:javascript
运行
复制
 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变量中,我设置了:

代码语言:javascript
运行
复制
 C:\\WORK\\Rtools\\bin; C:\\WORK\\Rtools\\gcc-  4.6.3\\bin; C:\\WORK\\R-3.3.0\\bin\\x64;" 

当我跑的时候

代码语言:javascript
运行
复制
 system('where make')

我得到了

代码语言:javascript
运行
复制
 C:\WORK\Rtools\bin\make.exe

当我跑的时候

代码语言:javascript
运行
复制
 system('g++ -v')

我得到了:

代码语言:javascript
运行
复制
 Using built-in specs.
 COLLECT_GCC=C:\WORK\Rtools\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) 

当我编译时,我得到这个错误:

代码语言:javascript
运行
复制
 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++

代码语言:javascript
运行
复制
 c:/Rtools/mingw_64/bin/g++

我不是已经把R设置成在

代码语言:javascript
运行
复制
 C:/WORK/Rtools? 

即使我手动添加了

代码语言:javascript
运行
复制
 c:/WORK/Rtools/mingw_64/bin/g++

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

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

EN

回答 5

Stack Overflow用户

发布于 2017-10-07 18:40:04

路径c:/Rtools/mingw_64/bin/被硬编码到文件Makeconf中,该文件位于R安装中的某个位置(在我的例子中是C:\Progs\R\R-3.4.1\etc\x64),作为变量BINPREF的值。

最简单的做法是将此路径更改为您的路径C:/WORK/Rtools/bin (在我的示例中为C:/Progs/RTools/3.4/mingw_64/bin/)。在R-3.4.1和Rtools3.4的全新安装中,这对我来说很有效,并且是一个最小的例子。

票数 18
EN

Stack Overflow用户

发布于 2016-08-23 10:23:59

正在发生的事情是需要在R 3.3.x的RTools 34和上运行,而不是在 33上。

删除rtools安装,然后按照此处的指导进行操作:

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

@David,您需要删除C:\WORK\Rtools\<something>的所有实例和任何重复的实例(例如C:\WORK\R-3.3.0\bin\x64出现两次)。然后添加:

工作c:\

\r工具\bin;c:\WORK\Rtools\mingw_32\bin;

票数 3
EN

Stack Overflow用户

发布于 2020-06-16 10:40:43

我在Windows10的RStudio 1.3+和RTools 4.0上也遇到了同样的问题。在安装RTools并尝试安装另一个包(需要RTools)后,它一直抛出错误

c:/rtools40/mingw32/bin/g++:没有这样的文件或目录

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

C:\RBuildTools\4.0\mingw32\bin

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39090983

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档