title: How to use (link) debug version of libc++ in macOS?
body: <p>I want to enable debug version of <code>libc++</code> in macOS, so I define <code>_LIBCPP_DEBUG=1</code> in <code>cxx_build_flags</code> <a href="https://libcxx.llvm.org/docs/DesignDocs/DebugMode.html#using-debug-mode" rel="nofollow noreferrer">[Debug Version of libC++]</a>,
  but unable to link debug function of <code>libc++</code>. I guess there is only release version of <code>libc++</code> in my system, so how can I get the debug version of <code>libc++</code> in macOS</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "std::__1::__libcpp_db::__decrementable(void const*) const", referenced from:
    void std::__1::__nth_element&lt;std::__1::__debug_less&lt;std::__1::__less&lt;float, float&gt; &gt;&amp;, std::__1::__wrap_iter&lt;float*&gt; &gt;(std::__1::__wrap_iter&lt;float*&gt;, std::__1::__wrap_iter&lt;float*&gt;, std::__1::__wrap_iter&lt;float*&gt;, std::__1::__debug_less&lt;std::__1::__less&lt;float, float&gt; &gt;&amp;)
  </code></pre>