gcc无法在Linux Mint下编译R包:无法找到stdlib.h

时间:2017-06-01 15:53:35

标签: r compiler-errors installation package linuxmint

我试图从Linux Mint命令行安装R包gtools。选择最近的CRAN镜像后,我收到的错误消息是没有找到这样的文件或目录,并且该软件包的安装具有非零退出状态。更具体地说:

> install.packages('gtools')
Installing package into ‘/home/lizi/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cloud.r-
project.org/src/contrib/gtools_3.5.0.tar.gz'
Content type 'application/x-gzip' length 64855 bytes (63 KB)
==================================================
downloaded 63 KB

* installing *source* package ‘gtools’ ...
** package ‘gtools’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c roman2int.c -o roman2int.o
In file included from roman2int.c:1:0:
/usr/share/R/include/R.h:55:80: fatal error: stdlib.h: No such file or 
directory
compilation terminated.
/usr/lib/R/etc/Makeconf:159: recipe for target 'roman2int.o' failed
make: *** [roman2int.o] Error 1
ERROR: compilation failed for package ‘gtools’
* removing ‘/home/lizi/R/x86_64-pc-linux-gnu-library/3.4/gtools’

The downloaded source packages are in
‘/tmp/Rtmp0z5PS6/downloaded_packages’
Warning message:
In install.packages("gtools") :
  installation of package ‘gtools’ had non-zero exit status

软件包没有依赖关系,我认为install.packages很简单。我做错了什么?

0 个答案:

没有答案