Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

While trying to install python dependencies on MacOS I encountered a build 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

I have xcode installed, and the xcode command line tools, and I use homebrew, so I have gcc 9.1 installed via homebrew.

Another concerning thing I see in the build is this:

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

my concern being that I'm not sure what macosx-10.7 refers to? I'm running mojave (10.14) and xcode is version 10.2.1, so what does 10.7 refer to?

like image 307
Bryant Avatar asked Aug 24 '26 15:08

Bryant


1 Answers

Surprisingly enough, this seems to do the trick (for bash):

export MACOSX_DEPLOYMENT_TARGET=10.9

I'm still not sure what 10.7 is vs 10.9, but this line in the error log:

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

lead to me discovering that exporting the deployment target effectively did what it was asking for.

like image 99
Bryant Avatar answered Aug 27 '26 04:08

Bryant