【发布时间】:2020-03-06 09:50:58
【问题描述】:
我在 R 中安装 devtools 包时遇到问题,而且似乎在 Mac 上已经遇到过这个问题。 我正在使用命令行
install.packages(“devtools”)
但在尝试安装依赖项时总是会收到错误消息。
主要错误信息如下:
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
Undefined symbols for architecture x86_64:
configure: error: C compiler cannot create executables
ERROR: compilation failed for package ‘fs’
Warning in install.packages :
installation of package ‘fs’ had non-zero exit status
checking whether the C compiler works... no
如果需要,我还可以放置整个错误消息。 最终导致未安装依赖项并且无法安装 devtools。
我已经尝试卸载 Xcode 并重新安装它,独立安装 CommandLineTool,独立安装依赖项。我检查了路径/Library/Developer/CommandLineTools/SDKs,其中包含MacOSX.sdk,但也包含MacOSX.sdk 1, MacOSX10.14.sdk and MacOSX10.15.sdk
【问题讨论】:
-
@roman-luštrik 我试过 xcode-select --install 但它已经安装了,我检查了 gcc 版本使用:
gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.0 (clang-1100.0.33.17) Target: x86_64-apple-darwin18.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin我尝试更新 gcc,安装 gcc5...