Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 274
MOOn Avatar asked Jul 12 '18 21:07

MOOn


1 Answers

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" 

Update Aug 2021

To avoid having to continuously update the exported value whenever you upgrade your OS, you can place the xcrun command directly in the shell script:

export SDKROOT=$(xcrun --show-sdk-path) 
like image 198
Paul Razvan Berg Avatar answered Oct 06 '22 18:10

Paul Razvan Berg