r - 在 rstudio 中安装 rgdal 库 - 在 libgdal 中找不到 GDALAllRegister

标签 r ubuntu rstudio gdal rgdal

我正在尝试使用 Ubuntu 12.10(量子)和 R 2.15.1(烤棉花糖)在 Rstudio (0.97.332) 中安装 rgdal 库。

我在 Ubuntu 中安装了以下关于 gdal 的内容:

$ apt-cache search gdal
dans-gdal-scripts - GDAL contributed tools by Geographic Information Network of Alaska
gdal-bin - Geospatial Data Abstraction Library - Utility programs
libgdal-dev - Geospatial Data Abstraction Library - Development files
libgdal-doc - Documentation for the Geospatial Data Abstraction Library
libgdal-perl - Perl bindings to the Geospatial Data Abstraction Library
libgdal-ruby - Ruby bindings to the Geospatial Data Abstraction Library
libgdal-ruby1.8 - Ruby 1.8 bindings to the Geospatial Data Abstraction Library
libgdal1 - Geospatial Data Abstraction Library
libgdal1-1.9.0-grass - GRASS extension for the GDAL library
libgdal1-dev - Geospatial Data Abstraction Library - Development files
python-gdal - Python bindings to the Geospatial Data Abstraction Library
qlandkartegt - GPS mapping (GeoTiff and vector) and GPSr management

我也安装了proj:

$ apt-cache search proj-
libproj-dev - Cartographic projection library (development files)
proj-bin - Cartographic projection library (tools)
proj-data - Cartographic projection filter and library (datum package)
proj-ps-doc - PostScript docs for cartographic projection filters and library
$ apt-cache search proj.4
libgeo-proj4-perl - PROJ.4 library for cartographic projections
python-mpltoolkits.basemap - matplotlib toolkit to plot on map projections
python-mpltoolkits.basemap-data - matplotlib toolkit to plot on map projections (data package)
python-mpltoolkits.basemap-doc - matplotlib toolkit to plot on map projections (documentation)
python-pyproj - Python interface to PROJ.4 library

现在我启动 rstudio 并运行 install.packages("rgdal",dependencies=TRUE) 我得到以下信息:

> install.packages("rgdal",dependencies=TRUE)
Installing package(s) into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/rgdal_0.8-5.tar.gz'
Content type 'application/x-gzip' length 1584889 bytes (1.5 Mb)
opened URL
==================================================
downloaded 1.5 Mb

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: rgdal: 0.8-4
checking for /usr/bin/svnversion... no
configure: svn revision: 449
configure: gdal-config: gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.9.0
checking GDAL version >= 1.7.1... yes
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
./configure: line 3373: g++: command not found
./configure: line 3388: g++: command not found
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/site-library/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

我不知道什么是 GDALAllRegister 以及下一步应该做什么。

最佳答案

检查你是否真的安装了c++。我怀疑你没有。

g++: command not found

关于r - 在 rstudio 中安装 rgdal 库 - 在 libgdal 中找不到 GDALAllRegister,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15569720/

相关文章:

python - 将 pandas 数据帧导出到 csv 时如何保持前导 0?

r - ggplot2:在 R 中创建视觉直观的时间线

ubuntu - CentOS 相当于 dpkg -s

c++ - 配置 : error: no boost. 找到文件系统库

r - 如何使用 Google Analytics (rga) 编写动态报告

github - 使用Rstudio发布时从Rpubs切换到github私有(private)仓库

r - apply 中的 ifelse 语句返回意外结果

r - 将模型公式传递给另一个函数时找不到对象错误

python - 使用 pip 在 python 3.5 上安装 uwsgi 时出错

r - 如何在 RStudio 中更改 .Rprofile 位置