3

while i tried to install packages on Rstudio,I kept encountering the ld warning like this:

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.

Does someone know how to fix this?

Paulo Mattos
  • 18,845
  • 10
  • 77
  • 85
a972ck
  • 33
  • 4

2 Answers2

8

Reinstalling CommandLineTools doesn't work for me.

These warnings were caused by the frameworks in /System/Library/Frameworks/.

The solution

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/
sudo ln -s  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework /Library/Frameworks/
jiyongdong
  • 350
  • 3
  • 7
2

First, you can safely ignore those messages. This is a known condition after the installation of Mojave (macOS 10.14) or the macOS 10.13.6+ updates.

You can try to remove them by having the OS regenerate the compatibility files (Apple uses a different library format for macOS app development but has a compatibility layer for "normal" development). To do that, set aside abt 8 minutes on a fast internet connection, open a command-line prompt (Terminal/iTerm) and do:

sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.old

then do:

xcode-select --install

and follow the instructions and wait.

Re-try your package/source compilations and if the messages go away, you should be able to safely do:

sudo rm -rf /Library/Developer/CommandLineTools.old

but leaving that directory tree there should not do any harm (provided you have the free space to spare).

hrbrmstr
  • 77,368
  • 11
  • 139
  • 205