R has been installing packages just fine, but suddenly – I can't think of anything relevant that I modified or uninstalled –
it can't find gcc when I run R CMD check
in the command prompt, or devtools::check()
in the R console; it delivers the following error:
* installing *source* package 'PkgName' ...
** libs
C:/MinGW/bin/gcc -I"C:/PROGRA~1/R/R-34~1.2/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O3 -Wall -std=gnu99 -mtune=core2 -c PkgName-init.c -o PkgName-init.o
C:/MinGW/bin/gcc: not found
I want R to find gcc in C:Rtools-3.4mingw_32in, which is the location specified in the system PATH; strsplit(Sys.getenv('PATH'), ';')
gives
[...]
[4] "c:\Rtools-3.4\bin"
[5] "c:\Rtools-3.4\mingw_32\bin"
[7] "C:\Program Files\R\R-3.4.2\bin\i386"
[8] "C:\Program Files\R\R-3.4.2\bin"
[9] "C:\Program Files\MiKTeX 2.9\miktex\bin\x64"
[...]
How can I tell R not to look in the non-existent directory C:MinGW, and instead to follow the PATH?
I don't want to install a second copy of MinGW there, as this causes other issues.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…