【问题标题】:Pybind11 doesn't work or C++ doesn't compile after upgrading to Mojave: -lstdc++ not found升级到 Mojave 后 Pybind11 不起作用或 C++ 无法编译:-lstdc++ not found
【发布时间】:2018-11-13 19:11:17
【问题描述】:

在升级 MacOS 之前,我能够安装 pybind11 示例 here。但是,在我将 MacOS 升级到 Mojave 后,当我在该链接上编译相同的示例时,我看到以下错误:

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 及其命令行工具?我也在 Majave 上工作,但我没有遇到这样的问题

标签: c++ macos-mojave pybind11


【解决方案1】:

我真的找到了答案。我只需要这样做

export MACOSX_DEPLOYMENT_TARGET=10.9

安装很顺利。

【讨论】:

    猜你喜欢
    • 2018-11-29
    • 2019-06-05
    • 2019-09-22
    • 1970-01-01
    • 2019-12-22
    • 1970-01-01
    • 1970-01-01
    • 2015-11-02
    • 2018-11-19
    相关资源
    最近更新 更多