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

前端 未结 6 1212
生来不讨喜
生来不讨喜 2021-01-30 08:31

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

ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/

6条回答
  •  花落未央
    2021-01-30 09:12

    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"
    

提交回复
热议问题