<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">You have to use clang++ if you are calling in c++ includes.

Then it will work.
</pre></blockquote><div class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">Having read over the other comments, and in case that wan’t clear — if you use /usr/bin/clang++ your build will automatically find the c++ includes, and you don’t need to do any of those suggestions with -isysroot or SDKROOT or xcrun etc.</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">It is presently failing because /usr/bin/clang does not automatically add the search path for the c++ includes, and <algorithm> is only in the c++ includes, not in the c includes.</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">K</pre></div></body></html>