From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:ae9:eb46:: with SMTP id b67mr29713234qkg.401.1568115096347; Tue, 10 Sep 2019 04:31:36 -0700 (PDT) X-Received: by 2002:a05:6830:204b:: with SMTP id f11mr4957833otp.16.1568115096104; Tue, 10 Sep 2019 04:31:36 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!85.12.16.70.MISMATCH!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!o24no4932936qtl.0!news-out.google.com!q23ni87qtl.1!nntp.google.com!o24no4932928qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 10 Sep 2019 04:31:35 -0700 (PDT) In-Reply-To: <567df5c4-2d91-4520-a30e-c210c3f3c515@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=220.235.51.39; posting-account=d51RWwoAAADvR-x0zYAtT9z3CRxT1eXo NNTP-Posting-Host: 220.235.51.39 References: <567df5c4-2d91-4520-a30e-c210c3f3c515@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <189a9e64-4238-4c75-b76d-75e6e63466c4@googlegroups.com> Subject: Re: Question for MacOS users of GNAT, gcc, and clang From: Roger Injection-Date: Tue, 10 Sep 2019 11:31:36 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2756 X-Received-Body-CRC: 1753122570 Xref: reader01.eternal-september.org comp.lang.ada:57118 Date: 2019-09-10T04:31:35-07:00 List-Id: On Saturday, September 7, 2019 at 9:01:20 AM UTC+10, John Perry wrote: > Hello all >=20 > 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 o= n what precise sequence of tricks I tried). I knew something had to be horr= ibly 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 t= he computer had recently rebooted. >=20 > 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 libstd= c++ at runtime, whereas MacOS links to libc++, which is why the program wou= ldn't build once I had it running. >=20 > 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 wi= th gcc? Something else? >=20 > thanks > john perry I run gprconfig to select the appropriate compilers which generates a defau= lt.cgpr file which I configure my Build Targets with using --config=3D/default.cgpr