升级到 Mojave 后 Pybind11 无法工作或 C++ 无法编译:-lstdc++ not found

try*_*lve 1 c++ pybind11 macos-mojave

在升级 MacOS 之前,我能够在此处安装 pybind11 示例。但是,在我将 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
Run Code Online (Sandbox Code Playgroud)

我缺少链接器命令吗?我在网上搜索过但找不到解决方案。

try*_*lve 5

我确实找到了答案。我只需要做

export MACOSX_DEPLOYMENT_TARGET=10.9

安装过程很顺利。