Pybind11 doesn't work or C++ doesn't compile after upgrading to Mojave: -lstdc++ not found

两盒软妹~` 提交于 2019-11-30 09:47:31

问题


I was able to install the pybind11 example here before I upgraded my MacOS. However, after I upgraded my MacOS to Mojave, when I compile the same example on that link, I see the following error:

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

Am I missing a linker command? I've searched online but couldn't find a solution.


回答1:


I actually found the answer. I only needed to do

export MACOSX_DEPLOYMENT_TARGET=10.9

The installation went smoothly.



来源:https://stackoverflow.com/questions/53287975/pybind11-doesnt-work-or-c-doesnt-compile-after-upgrading-to-mojave-lstdc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!