在我尝试安装的任何R包中,都会收到以下错误消息:
ld: library not found for -lintl
collect2: error: ld returned 1 exit status
make: *** [utf8.so] Error 1我不确定如何使其成为reprex,但我正在运行:R版本4.0.2 (2020-06-22)平台: x86_64-apple-darwin19.5.0 (64位)在macOS Catalina 10.15.5下运行
这个错误消息(ld: library not found for -lintl)是什么意思,我如何修复它才能安装R包(我尝试过的包是texreg和lme4)?谢谢。
编辑:我很抱歉,我以为我的帖子中已经包含了这一点。我没有遗漏gettext (根据Link error installing Rcpp "library not found for -lintl"),我按照说明导出了LPDFLAGS和CPPFLAGS,以便将它们链接在一起。
据我所知,问题出在~/.R/Makevars文件中,它目前看起来像这样,我在其中注释掉了基于googling搜索添加到其中的内容。
CC=/usr/local/Cellar/gcc/9.3.0_1/bin/gcc-9
CXX=/usr/local/Cellar/gcc/9.3.0_1/bin/g++-9
CXX11=/usr/local/Cellar/gcc/9.3.0_1/bin/g++-9
CXX14=/usr/local/Cellar/gcc/9.3.0_1/bin/g++-9
cxx17=/usr/local/cellar/gcc/9.3.0_1/bin/g++-9
cxx1X=/usr/local/cellar/gcc/9.3.0_1/bin/g++-9
LDFLAGS=-L/usr/local/Cellar/gcc/9.3.0_1/lib
#FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0
#CC=/usr/local/clang4/bin/clang
#CXX=/usr/local/clang4/bin/clang++
#CXX1X=/usr/local/clang4/bin/clang++
#CXX98=/usr/local/clang4/bin/clang++
#CXX11=/usr/local/clang4/bin/clang++
#CXX14=/usr/local/clang4/bin/clang++
#CXX17=/usr/local/clang4/bin/clang++
#LDFLAGS=-L/usr/local/clang4/lib发布于 2020-06-28 04:15:04
显然,我需要删除~/.R/Makevars中的所有行,才能安装lme4。我确实收到了一些警告,但library(lme4)工作正常。
https://stackoverflow.com/questions/62605417
复制相似问题