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

MOOn picture MOOn · Jul 12, 2018 · Viewed 16.8k times · Source

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.

Answer

Paul Razvan Berg picture Paul Razvan Berg · Mar 25, 2019

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"