Can't install package using RTools

Hello,
I just installed the lastest R (RStudio 4.0.0, R1.3.1093, and RTools40). But when I tried to reinstall the rlang, it doesn't work.

> install.packages("rlang")
> WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
> https://cran.rstudio.com/bin/windows/Rtools/
> Installing package into ‘C:/Users/asus/Documents/R/win-library/4.0’
> (as ‘lib’ is unspecified)
> 
>   There is a binary version available but the source
>   version is later:
>       binary source needs_compilation
> rlang  0.4.7  0.4.8              TRUE
> 
> installing the source package ‘rlang’
> 
> trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.4.8.tar.gz'
> Content type 'application/x-gzip' length 847517 bytes (827 KB)
> downloaded 827 KB
> 
> * installing *source* package 'rlang' ...
> ** package 'rlang' successfully unpacked and MD5 sums checked
> ** using staged installation
> ** libs
> 
> *** arch - i386
> "c:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c capture.c -o capture.o
> "c:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c export.c -o export.o
> "c:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c internal.c -o internal.o
> In file included from ./lib/rlang.h:74,
>                  from internal/arg.c:1,
>                  from internal.c:1:
> internal/eval-tidy.c: In function 'rlang_tilde_eval':
> ./lib/env.h:33:10: warning: 'top' may be used uninitialized in this function [-Wmaybe-uninitialized]
>    return ENCLOS(env);
>           ^~~~~~~~~~~
> In file included from internal.c:8:
> internal/eval-tidy.c:406:9: note: 'top' was declared here
>    sexp* top;
>          ^~~
> "c:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c lib.c -o lib.o
> "c:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c version.c -o version.o
> process_begin: CreateProcess(NULL, basename rlang.dll .dll, ...) failed.
> process_begin: CreateProcess(NULL, basename rlang.dll .dll, ...) failed.
> process_begin: CreateProcess(NULL, basename rlang.dll .dll, ...) failed.
> "zcapture.o export.o internal.o lib.o version.o" was unexpected at this time.
> make: *** [rlang.dll] Error 255
> ERROR: compilation failed for package 'rlang'
> * removing 'C:/Users/asus/Documents/R/win-library/4.0/rlang'
> Warning in install.packages :
>   installation of package ‘rlang’ had non-zero exit status
> 
> The downloaded source packages are in
> 	‘C:\Users\asus\AppData\Local\Temp\RtmpEjmbCp\downloaded_packages’

Same issu ocure when I installed ggplot2

So, what should I do?

It seems you haven't set your PATH variable correctly, try following RTools40 installation instructions again.

I have the same issue, though my Rtools seems to be working fine:

Installing package into ‘D:/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
      binary source needs_compilation
rlang  0.4.7  0.4.8              TRUE

installing the source package ‘rlang’

trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.4.8.tar.gz'
Content type 'application/x-gzip' length 847517 bytes (827 KB)
downloaded 827 KB

* installing *source* package 'rlang' ...
** package 'rlang' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
D:/Rtools40/mingw64/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c capture.c -o capture.o
D:/Rtools40/mingw64/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c export.c -o export.o
D:/Rtools40/mingw64/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c internal.c -o internal.o
In file included from ./lib/rlang.h:74,
                 from internal/arg.c:1,
                 from internal.c:1:
internal/eval-tidy.c: In function 'rlang_tilde_eval':
./lib/env.h:33:10: warning: 'top' may be used uninitialized in this function [-Wmaybe-uninitialized]
   return ENCLOS(env);
          ^~~~~~~~~~~
In file included from internal.c:8:
internal/eval-tidy.c:406:9: note: 'top' was declared here
   sexp* top;
         ^~~
D:/Rtools40/mingw64/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c lib.c -o lib.o
D:/Rtools40/mingw64/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c version.c -o version.o
D:/Rtools40/mingw64/bin/gcc -shared -s -static-libgcc -o rlang.dll tmp.def capture.o export.o internal.o lib.o version.o -LC:/PROGRA~1/R/R-40~1.2/bin/i386 -lR
D:/Rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~1/R/R-40~1.2/bin/i386/R.dll when searching for -lR
D:/Rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~1/R/R-40~1.2/bin/i386/R.dll when searching for -lR
D:/Rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lR
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'rlang'
* removing 'D:/Documents/R/win-library/4.0/rlang'
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\Thomas\AppData\Local\Temp\RtmpwNd6aL\downloaded_packages’
'''

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.