MacOS 构建问题 lstdc++ not found while building python package

MacOS build issues lstdc++ not found while building python package

尝试在 MacOS 上安装 python 依赖项时遇到构建错误。

    clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
    ld: library not found for -lstdc++
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'g++' failed with exit status 1

我安装了 xcode 和 xcode 命令行工具,我使用自制软件,所以我通过自制软件安装了 gcc 9.1。

我在构建中看到的另一件事是:

  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.7

我担心的是我不确定 macosx-10.7 指的是什么?我是运行 mojave (10.14) xcode 是10.2.1版本,那么10.7指的是什么?

令人惊讶的是,这似乎可以解决问题(bash):

export MACOSX_DEPLOYMENT_TARGET=10.9

我仍然不确定 10.7 和 10.9 是什么,但是错误日志中的这一行:

move to libc++ with a minimum deployment target of OS X 10.9

让我发现导出部署目标有效地完成了它所要求的。