我现在已经在我办公室的台式计算机上的一个 R 项目上工作了一段时间,但在旅行时需要随身携带这些脚本。我将所有内容复制到笔记本电脑中,并对代码进行了一些更改。唉,在尝试编译时(按照我在台式计算机中使用的完全相同的过程),出现以下错误:
$ R CMD INSTALL --no-multiarch --with-keep.source coala
* installing to library ‘/home/my_pc/R/x86_64-pc-linux-gnu-library/3.3’
* installing *source* package ‘coala’ ...
** libs
make: Nothing to be done for `all'.
installing to /home/my_pc/R/x86_64-pc-linux-gnu-library/3.3/coala/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/my_pc/R/x86_64-pc-linux-gnu-library/3.3/coala/libs/coala.so':
/home/my_pc/R/x86_64-pc-linux-gnu-library/3.3/coala/libs/coala.so: undefined symbol: _ZSt24__throw_out_of_range_fmtPKcz
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/my_pc/R/x86_64-pc-linux-gnu-library/3.3/coala’
* restoring previous ‘/home/my_pc/R/x86_64-pc-linux-gnu-library/3.3/coala’
两台计算机都有相同的 Ubuntu 但不同的 R 版本。另外,我不得不提一下,我同时在两个库中工作,并且随附的库更新没有问题,这使得这个错误消息更加令人费解。我已经检查了可能与此问题相关的答案,但无法弄清楚如何应用他们的解决方案:
R:安装包 UBUNTU 时出错 - dyn.load(file, DLLpath = DLLpath, …) 中的错误:无法加载共享对象 得到消息无法加载共享对象 stats.so 当 R 启动时
有没有办法解决这个问题?可能是哪个原因?什么是未定义的符号 _ZSt24__throw_out_of_range_fmtPKcz
?
原文由 j91 发布,翻译遵循 CC BY-SA 4.0 许可协议
我在 Ubuntu 上与
rgdal
有类似的问题。重新安装软件包足以让它再次工作。