admin管理员组

文章数量:1431935

I am new to R and I am trying to install a package called Rfits from github which can be found here , using the "remotes" library. My OS is Windows 11.

Firstly I downloaded R 4.4.2, then rtools44 from the cran website. Then, inside of the R gui on my desktop I used the following functions as instructed on the Rfits github page:

install.packages("remotes")
library(remotes)
remotes::install_github("asgr/Rfits")

R outputs a bunch of lines which seem correct but then it fails and gives the following lines:

make[1]: Leaving directory '/c/Users/me/AppData/Local/Temp/RtmpuWs8gY/R.INSTALL4a7c1e543783/Rfits/src/cfitsio'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin\nm.exe: Warning: 'cfitsio' is a directory
g++ -std=gnu++17 -shared -s -static-libgcc -o Rfits.dll tmp.def RcppExports.o Rfits.o cfitsio/libcfitsio.a -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-44~1.2/bin/x64 -lR
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0xa2): undefined reference to `inflateInit2_'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x116): undefined reference to `inflate'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x15c): undefined reference to `inflate'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x195): undefined reference to `inflateEnd'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x1f4): undefined reference to `inflateEnd'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x29d): undefined reference to `inflateInit2_'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x313): undefined reference to `inflate'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x33a): undefined reference to `inflateEnd'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x354): undefined reference to `inflateEnd'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x428): undefined reference to `inflateInit2_'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x4bf): undefined reference to `inflate'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x516): undefined reference to `inflateEnd'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x534): undefined reference to `inflateEnd'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x613): undefined reference to `deflateInit2_'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x689): undefined reference to `deflate'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x6b0): undefined reference to `deflateEnd'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x6c4): undefined reference to `deflateEnd'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x79c): undefined reference to `deflateInit2_'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x82b): undefined reference to `deflate'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x87f): undefined reference to `deflateEnd'
C:\rtools44\x86_64-w64-mingw32.static.posix\bin/ld.exe: cfitsio/libcfitsio.a(zcompress.o):zcompress.c:(.text+0x8f4): undefined reference to `deflateEnd'
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'Rfits'
* removing 'C:/Users/me/AppData/Local/R/win-library/4.4/Rfits'
Warning message:
In i.p(...) :
  installation of package ‘C:/Users/me/AppData/Local/Temp/RtmpKiTwfT/file578833fa1c37/Rfits_1.12.3.tar.gz’ had non-zero exit status

Does anyone know how to fix this so I can properly install Rfits onto my system? The problematic part seems to be the "undefined reference to [inflate/deflate]".

本文标签: ERROR compilation failed when installing a package in R from githubStack Overflow