<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr"><br></div><div dir="ltr"><br><blockquote type="cite">On 18 Sep 2022, at 11:58 pm, Chris Jones <jonesc@hep.phy.cam.ac.uk> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div dir="ltr"></div><div dir="ltr"><br></div><div dir="ltr"><br><blockquote type="cite">On 18 Sep 2022, at 1:29 pm, René J.V. Bertin <rjvbertin@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span>Hi,</span><br><span></span><br><span>Building C++ code that does</span><br><span></span><br><span>#include <filesystem></span><br><span></span><br><span>I get either a file-not-found error or a bunch of errors that the functions are 10.15+ only. What's with that?</span><br></div></blockquote><div><br></div>Seems pretty clear to me…<div><br><blockquote type="cite"><div dir="ltr"><span></span><span>If the implementation is provided by libc++, isn't this something that could be patched? Shouldn't require any external dependencies on systems that already underwent the libc++ conversion.</span><br><span></span><br><span>On more recent systems that have a stock libc++ one can install `port:libcxx` with the binaries under $prefix . I have been doing that for years so all MacPorts executables use it, and that has never caused any ABI issues with system libraries that were built against the stock libc++ version.</span><br><span>In fact, I often use my own build for other applications as well, assuming they'll benefit from newer=better and the maximum optimisation I used in the build.</span></div></blockquote><div><br></div>There is a difference between what c++ language features a compiler supports, and what features the standard library used supports. If your system Xcode does not support a given feature, you can try using a newer clang from macports. However, all clang compilers supplied by Xcode, and macports use the system libc++ support library.<br><div><br></div>Just installing libcxx does nothing in itself, unless you are on very old OS versions which have no system libc++ support. If your system does, then installing the port has no bearing on what ports will subsequently use. If you wish this to happen you are expected to manually replace the system library. See the port notes (which i assume tou have already read right)</div><div><br></div><div><a href="https://ports.macports.org/port/libcxx/details/">https://ports.macports.org/port/libcxx/details/</a></div><div><br></div><div><span class="lead mb-0 mt-0" style="box-sizing: border-box; font-size: 1.25rem; caret-color: rgb(81, 81, 81); color: rgb(81, 81, 81); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%; margin-top: 0px !important; margin-bottom: 0px !important;">“libc++ is a new implementation of the C++ standard library with support for C++11 and portions of C++14.</span><span style="caret-color: rgb(81, 81, 81); color: rgb(81, 81, 81); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 17.600000381469727px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%; background-color: rgb(255, 255, 255);"></span><span style="caret-color: rgb(81, 81, 81); color: rgb(81, 81, 81); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 17.600000381469727px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%; background-color: rgb(255, 255, 255);"></span><p class="my-0 pt-0" id="long_description_full" style="box-sizing: border-box; caret-color: rgb(81, 81, 81); color: rgb(81, 81, 81); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 17.600000381469727px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%; margin-top: 0px !important; margin-bottom: 0px !important; padding-top: 0px !important;">libc++ is a new implementation of the C++ standard library with support for C++11 and portions of C++14. Because objects cannot be passed between different versions of the C++ runtime, this port must replace the host version in order to be used. On Snow Leopard and earlier, this is done automatically because there is no existing host version of this library. On Lion and later, users must build the port with +replacemnt_libcxx and install the root manually if they wish to replace the existing host implementation.“</p></div></div></blockquote><div><br></div>Just to add. I don’t use the port myself as I prefer to keep my systems up to date, but rereading the above and looking at the version the port installs, its not obvious to me if the current version really has complete c++17 support either…<div><br><blockquote type="cite"><div dir="ltr"><div><br></div><div>Follow the above at your own risk.</div><div><br></div><div>The much better solution, imho, is if you needed newer c++ support, just migrate to a more recent os that supports it…</div><div><br></div><div>Chris</div><div><br></div><div><br><blockquote type="cite"><div dir="ltr"><span></span><br><span>R.</span><br></div></blockquote></div></div></blockquote></div></body></html>