xcode ld:警告:基于文本的存根文件不同步。回退到库文件进行链接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/51314888/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ld: warning: text-based stub file are out of sync. Falling back to library file for linking
提问by MOOn
When I am trying to sourceCpp
, it gives a warning:
当我尝试时sourceCpp
,它会发出警告:
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld:警告:基于文本的存根文件 /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd 和库文件 /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation 不同步。回退到库文件进行链接。
But the function actually works. Just wondering how to solve this warning.
但该功能确实有效。只是想知道如何解决这个警告。
回答by Paul Razvan Berg
Using MacOS Mojave 10.14.2, the fix for me was to use the solution from this comment on GitHub:
使用 MacOS Mojave 10.14.2,我的修复方法是使用GitHub 上此评论中的解决方案:
export SDKROOT=macosx10.14
Put the line above in your ~/.bash_profile
. Replace 10.14
with your specific version of MacOSX Xcode tools. Find out what version you have by doing:
将上面的行放在您的~/.bash_profile
. 替换10.14
为您特定版本的 MacOSX Xcode 工具。通过执行以下操作找出您拥有的版本:
xcrun --show-sdk-path
It will print something like:
它将打印如下内容:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
Just grab the last word, make it all lower caps and replace it in the export
command above.
只需抓住最后一个单词,将其全部大写并在export
上面的命令中替换它。
Update Sep 2019
2019 年 9 月更新
In the latest release, they removed the version number from the sdk. Just grab the full path and export it as SDKROOT
, like this:
在最新版本中,他们从 sdk 中删除了版本号。只需获取完整路径并将其导出为SDKROOT
,如下所示:
export SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
回答by jiyongdong
I had this problem while compiling Go code on my Mac too.
我在 Mac 上编译 Go 代码时也遇到了这个问题。
The tld files were out of sync in /System/Library/Frameworks/
.
tld 文件在/System/Library/Frameworks/
.
The solution:
解决办法:
Just links the recent frameworks from MacOSX.sdkto /Library/Frameworks/
只需将MacOSX.sdk 中的最新框架链接到 /Library/Frameworks/
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework /Library/Frameworks/CoreFoundation.framework
回答by Highstead
Edit:this seems to have stopped working post 10.13.16. Trying it will not hurt your mac after the re-install but i'm not sure how to fix it going forward.
编辑:这似乎在 10.13.16 后停止工作。重新安装后尝试它不会伤害您的 Mac,但我不确定如何解决它。
Came across this recently, just remove the command line tools for mac and re-install.
最近遇到了这个,只需删除mac的命令行工具并重新安装。
$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
After these steps you will see a pop to install the new version of the tools.
完成这些步骤后,您将看到安装新版本工具的弹出窗口。
回答by UberFarmer
Reinstalling may help, but also may not.
重新安装可能有帮助,但也可能没有。
It's Apple's fault and they need to fix it with another command line tools update.
这是 Apple 的错,他们需要使用另一个命令行工具更新来修复它。
Just ignore the warning for now.
暂时忽略警告。
(See a bunch of other people experiencing the issue here: https://github.com/vim/vim/issues/3445and here: https://github.com/golang/go/issues/26073)
(在此处查看其他遇到此问题的人:https: //github.com/vim/vim/issues/3445和此处:https: //github.com/golang/go/issues/26073)
回答by Qiang Kou
I think this has nothing to do with Rcpp.
我认为这与 Rcpp 无关。
This is related to your system.
这与您的系统有关。
I show first lines of one tbd file below. It is just a text file. You can open it using a text editor.
我在下面显示了一个 tbd 文件的第一行。它只是一个文本文件。您可以使用文本编辑器打开它。
--- !tapi-tbd-v3
archs: [ i386, x86_64, x86_64h ]
uuids: [ 'i386: 17321B27-67AB-3D26-B9DF-A69624B1C82B', 'x86_64: 358C547D-E227-3228-8218-62327F4605C8',
'x86_64h: 945E5C0A-86C5-336E-A64F-5BF06E78985A' ]
platform: macosx
install-name: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
current-version: 1452.23
compatibility-version: 150
exports:
- archs: [ i386 ]
symbols: [ '$ld$add$os10.5$.objc_class_name_NSObject', '$ld$add$os10.6$.objc_class_name_NSObject',
'$ld$add$os10.7$.objc_class_name_NSObject', '$ld$hide$os10.4$.objc_class_name_NSArray',
'$ld$hide$os10.4$.objc_class_name_NSCalendar', '$ld$hide$os10.4$.objc_class_name_NSData',
...
As I understand, the tbd file contains the version and location of the real library file. It is like a "link". (Just my personal understanding. Please correct me if this is wrong.)
据我了解,tbd 文件包含真实库文件的版本和位置。它就像一个“链接”。(仅个人理解,如有不对请指正。)
After the upgrade of Xcode, your tbd file and real library are out of sync. Then you got the warning.
Xcode升级后,你的tbd文件和真实库不同步了。然后你得到了警告。
I think you can ignore this warning for now, since your compiler has fallen back and found the correct library.
我认为您现在可以忽略此警告,因为您的编译器已经回退并找到了正确的库。
回答by John
The dates of CoreFoundation and CoreFoundation.tbd show that the latter is much older. This suggests it can be ignored. The out of sync problem can easily be cured by deleting the .tbd file. It is not needed and if not present cannot generate the out of sync error.
CoreFoundation 和 CoreFoundation.tbd 的日期表明后者更旧。这表明它可以被忽略。通过删除 .tbd 文件可以轻松解决不同步问题。它不是必需的,如果不存在就不会产生不同步错误。
I use CoreFoundation and IOKit on 10.13.6 and this is a simple solution avoiding reloading CommandLine tools or setting links or trying to export SDKs etc.
我在 10.13.6 上使用 CoreFoundation 和 IOKit,这是一个简单的解决方案,可避免重新加载命令行工具或设置链接或尝试导出 SDK 等。
John
约翰