Rstudio,配置:错误:在libgdal中找不到GDALAllRegister

Rstudio, configure: error: GDALAllRegister not found in libgdal

本文关键字:找不到 GDALAllRegister libgdal 错误 配置 Rstudio      更新时间:2023-10-16

我是新手,已经尝试了各种方法。我从这个问题中遇到了问题。请帮忙。我认为这里有两个问题。1(我的C ++不是最新的。2(我的GDALAllRegister在libgdal中找不到。

我正在使用 mac 2017。

> install.packages("sf")
Installing package into ‘/Users/haoluo/Library/R/3.4/library’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
sf  0.6-1  0.6-3              TRUE
Do you want to install from sources the package which needs compilation?
y/n: y
installing the source package ‘sf’
...
In file included from /usr/local/Cellar/gdal/HEAD-41888/include/gdal.h:42:
/usr/local/Cellar/gdal/HEAD-41888/include/cpl_port.h:187:6: error: Must have C++11 or newer.
#    error Must have C++11 or newer.
^
1 error generated.
In file included from gdal_test.cpp:1:
In file included from /usr/local/Cellar/gdal/HEAD-41888/include/gdal.h:42:
/usr/local/Cellar/gdal/HEAD-41888/include/cpl_port.h:187:6: error: Must have C++11 or newer.
#    error Must have C++11 or newer.
^
1 error generated.
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘sf’
* removing ‘/Users/haoluo/Library/R/3.4/library/sf’
Warning in install.packages :
installation of package ‘sf’ had non-zero exit status

我一开始就没有阅读提示。现在,只需回答n问题即可解决问题Do you want to install from sources the package which needs compilation?

我要再次感谢@nicola的帮助!

在此处输入图像描述