Help with UsingTheRightCompiler
Frank Schima
mf2k at macports.org
Fri Jul 24 18:47:14 UTC 2020
Hi Ken,
> On Jul 23, 2020, at 10:38 PM, Ken Cunningham <ken.cunningham.webuse at gmail.com> wrote:
>
>> You have to use clang++ if you are calling in c++ includes.
>>
>> Then it will work.
>
> 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.
> 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.
Thanks for the advice. I’m having problems implementing it though.
I tried setting CC like so:
build.args CC="${configure.cpp} [get_canonical_archflags cc]"
But it still does not work. Here is the resulting compiler used:
/usr/bin/cpp -arch x86_64 -Wall -g -O2 -I/opt/X11/include -DPNG -DPNG15 -Wno-write-strings -Wno-overflow -c ascii.c
Also, I don’t see clang++ in the compilers listed in https://trac.macports.org/wiki/UsingTheRightCompiler <https://trac.macports.org/wiki/UsingTheRightCompiler>.
So I hacked it by using:
build.args CC="/usr/bin/clang++"
And it builds! But that does not seem to be the Macports way. How can I set the compiler with Macports?
Thoughts?
Cheers!
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20200724/baf63a07/attachment-0001.htm>
More information about the macports-dev
mailing list