3

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?

3
  • You probably want to install those Python dependencies with the gcc installed through Homebrew then; that'll have no problem with its own libstdc++. You could try and put the path to gcc at the front of your PATH when building them; or adjust the setup.py. Commented May 10, 2019 at 19:30
  • I think the 10.7 is just very generic, and indicates anything compatible with 10.7 and upwards. But that's just a guess. Commented May 10, 2019 at 19:31
  • For what it's worth: I'm seeing a build/lib.macosx-10.13-x86_64-3.7 on my machine for MacOS 10.14.4. That is a C/Cython extension, no C++. Commented May 10, 2019 at 19:35

1 Answer 1

16

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.