的名称空间加载失败

的名称空间加载失败

本文介绍了"sf"(R包)的名称空间加载失败,无法加载共享对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Centos机器上安装R'sf'.在gdal扩展问题(现在已通过源代码修复)之后,我得到了:

I am attempting to install R 'sf' on a Centos machine. After extended problems with gdal (now fixed by building from source), I now get:

Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):

无法加载共享对象'/home/my_user_name/R/x86_64-redhat-linux-gnu-库/3.4/sf/libs/sf.so':/home/my_user_name/R/x86_64-redhat-linux-gnu-library/3.4/sf/libs/sf.so:未定义的符号: ZN15OGRMultiSurface18CastToMultiPolygonEPS

unable to load shared object '/home/my_user_name/R/x86_64-redhat-linux-gnu- library/3.4/sf/libs/sf.so': /home/my_user_name/R/x86_64-redhat-linux-gnu-library/3.4/sf/libs/sf.so: undefined symbol: ZN15OGRMultiSurface18CastToMultiPolygonEPS

如何解决此错误?

推荐答案

因此,此问题显然是由于我手动安装的gdal无法正确链接到geos引起的.

So, this problem was apparently caused by my manual install of gdal not correctly linking to geos.

因此,我按照以下说明重新安装了gdal( https://trac.osgeo.org/gdal/wiki/BuildingOnUnix ),其中--with-geos = yes是./configure的标志.

So I just reinstalled gdal following these instructions (https://trac.osgeo.org/gdal/wiki/BuildingOnUnix) with --with-geos=yes as a flag to ./configure.

这解决了问题.

这篇关于"sf"(R包)的名称空间加载失败,无法加载共享对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 07:27