* Question for MacOS users of GNAT, gcc, and clang
@ 2019-09-06 23:01 John Perry
2019-09-10 11:31 ` Roger
0 siblings, 1 reply; 2+ messages in thread
From: John Perry @ 2019-09-06 23:01 UTC (permalink / raw)
Hello all
I spent about 2 hours yesterday trying to figure out why a C++ program I've been working on a while wouldn't compile, link, or even run (depending on what precise sequence of tricks I tried). I knew something had to be horribly wrong because dyld insisted that it couldn't find the standard library's "thread.join()" method, but the only thing I knew for certain was that the computer had recently rebooted.
Eventually I discovered that the problem was in my PATH variable, because GNAT expects/requires gcc, whereas the default compiler on MacOS is clang, which I need for various reasons not worth getting into. But, for instance, gcc was compiling with the expectation that the program would find libstdc++ at runtime, whereas MacOS links to libc++, which is why the program wouldn't build once I had it running.
This was reasonably easily fixed, and hopefully I'll remember next time, but I was wondering what other MacOS Ada & C++ developers do to avoid this: Run a script when you want to start Ada? Dump clang altogether and live with gcc? Something else?
thanks
john perry
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Question for MacOS users of GNAT, gcc, and clang
2019-09-06 23:01 Question for MacOS users of GNAT, gcc, and clang John Perry
@ 2019-09-10 11:31 ` Roger
0 siblings, 0 replies; 2+ messages in thread
From: Roger @ 2019-09-10 11:31 UTC (permalink / raw)
On Saturday, September 7, 2019 at 9:01:20 AM UTC+10, John Perry wrote:
> Hello all
>
> I spent about 2 hours yesterday trying to figure out why a C++ program I've been working on a while wouldn't compile, link, or even run (depending on what precise sequence of tricks I tried). I knew something had to be horribly wrong because dyld insisted that it couldn't find the standard library's "thread.join()" method, but the only thing I knew for certain was that the computer had recently rebooted.
>
> Eventually I discovered that the problem was in my PATH variable, because GNAT expects/requires gcc, whereas the default compiler on MacOS is clang, which I need for various reasons not worth getting into. But, for instance, gcc was compiling with the expectation that the program would find libstdc++ at runtime, whereas MacOS links to libc++, which is why the program wouldn't build once I had it running.
>
> This was reasonably easily fixed, and hopefully I'll remember next time, but I was wondering what other MacOS Ada & C++ developers do to avoid this: Run a script when you want to start Ada? Dump clang altogether and live with gcc? Something else?
>
> thanks
> john perry
I run gprconfig to select the appropriate compilers which generates a default.cgpr file which I configure my Build Targets with using --config=<path>/default.cgpr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-10 11:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 23:01 Question for MacOS users of GNAT, gcc, and clang John Perry
2019-09-10 11:31 ` Roger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox