【问题标题】:VLC compile on mac can't find MacOSX.sdkVLC在mac上编译找不到MacOSX.sdk
【发布时间】:2020-02-06 18:41:50
【问题描述】:

按照 VLC macOS 编译 wiki 页面。使用单个命令构建指令。我正在使用 Xcode 11.3.1 命令行工具、开发人员签名等运行 10.14.6。

重要提示——我的 MacOSX.sdk 文件位于此处: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

通过构建创建makefile,完成引导并运行make,一切都很好。然后我收到以下错误——如何将 VLC 指向我的 MacOSX.sdk 文件所在的位置?

IOW如何设置vlc的“contrib环境”?

请注意,在下面的代码片段中,contrib 将 MacOSX.sdk 文件指针设置为错误的位置 - 我该如何修复?

我需要在 vlc 源代码中编辑一些内容吗?谢谢。错误:

Setting base environment
Using VLC root dir /Users/GR99/temp/VLC/vlc and triplet x86_64-apple-darwin18
[build] Checking for python3 ...
Python 3.8.1
[build] Building in "/Users/GR99/temp/VLC/vlc/build"
[build] Building building tools
You are ready to build VLC and its contribs
Setting symbol environment
Setting contrib environment with minimum macOS version 10.11 and SDK /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
[build] Building contribs
Packages licensing...    GPL version 3
Creating makefile...
Bootstrap completed.
Run "make" to start compilation.

....

make: Nothing to be done for `fetch'.
make: `.gettext' is up to date.
# Framework
cd breakpad/src/client/mac/ && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64 CLANG_CXX_LIBRARY=libc++
# Build Sparkle and change the @rpath
cd sparkle && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
make: *** [.sparkle] Error 64
make: *** [.breakpad] Error 64
make: Target `all' not remade because of errors.
# Framework
cd breakpad/src/client/mac/ && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64 CLANG_CXX_LIBRARY=libc++
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
make: *** [.breakpad] Error 64

【问题讨论】:

    标签: macos vlc


    【解决方案1】:

    cf:../extras/package/macosx/build.sh -h
    上面写着:

    usage: extras/package/macosx/build.sh [options]
    
    Build vlc in the current directory
    
    OPTIONS:
       -h            Show some help
       -q            Be quiet
       -j            Force number of cores to be used
       -r            Rebuild everything (tools, contribs, vlc)
       -c            Recompile contribs from sources
       -p            Build packages for all artifacts
       -i <n|u>      Create an installable package (n: nightly, u: unsigned stripped release archive)
       -k <sdk>      Use the specified sdk (default: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk)
       -a <arch>     Use the specified arch (default: x86_64)
       -C            Use the specified VLC build dir
       -b <url>      Enable breakpad support and send crash reports to this URL
       -d            Disable debug mode (on by default)
    

    您的构建命令还应使用 -k 选项包含您的 SDK 的位置:

    ../extras/package/macosx/build.sh -c -k /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

    script 使用 xcrun --show-sdk-path 来设置 SDK。 xcrun 使用环境变量 $SDKROOT。

    注意:您可能想要安装和使用版本化 SDK,例如在您的问题中,输出显示它的目标是最低 El Capitan/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk 版本化的 SDK 在旧 Xcode 和 github 上可用。

    设置“contrib 环境”全部由“单个命令”处理。

    【讨论】:

    • 谢谢!我有 MacOSX10.15.sdk,可以指出这一点——非常感谢。
    • 当然。您将能够使用该 SDK 以 macOS 10.15+ 为目标。
    猜你喜欢
    • 1970-01-01
    • 2013-04-22
    • 2014-07-26
    • 2015-01-27
    • 1970-01-01
    • 1970-01-01
    • 2011-09-10
    • 2014-02-11
    • 1970-01-01
    相关资源
    最近更新 更多