ld: warning: text-based stub file are out of sync. Falling back to library file for linking

风格不统一 提交于 2019-12-20 08:35:51

问题


When I am trying to sourceCpp, it gives a warning:

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.

But the function actually works. Just wondering how to solve this warning.


回答1:


I had this problem while compiling Go code on my Mac too.

The tld files were out of sync in /System/Library/Frameworks/.

The solution:

Just links the recent frameworks from MacOSX.sdk to /Library/Frameworks/

sudo ln -s  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework /Library/Frameworks/CoreFoundation.framework



回答2:


Using MacOS Mojave 10.14.2, the fix for me was to use the solution from this comment on 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:

xcrun --show-sdk-path

It will print something like:

/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.

Update Sep 2019

In the latest release, they removed the version number from the sdk. Just grab the full path and export it as SDKROOT, like this:

export SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"



回答3:


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.

Came across this recently, just remove the command line tools for mac and re-install.

$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install

After these steps you will see a pop to install the new version of the tools.




回答4:


Reinstalling may help, but also may not.

It's Apple's fault and they need to fix it with another command line tools update.

Just ignore the warning for now.

(See a bunch of other people experiencing the issue here: https://github.com/vim/vim/issues/3445 and here: https://github.com/golang/go/issues/26073)




回答5:


I think this has nothing to do with 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.

--- !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.)

After the upgrade of Xcode, your tbd file and real library are out of sync. Then you got the warning.

I think you can ignore this warning for now, since your compiler has fallen back and found the correct library.



来源:https://stackoverflow.com/questions/51314888/ld-warning-text-based-stub-file-are-out-of-sync-falling-back-to-library-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!