Re: Updating to Xcode 10


John Brownie
 

I discovered one thing that is a bug in Xcode. In the section Apple Clang - Language - C++, if you set the C++ Standard Library to the option libstdc++ (GNU C++ Standard Library), it generates the -std=libstdc++. When it fails to find it, it generates the erroneous warning.

Anyway, it looks as though the issue is that the C++ library that I rely on is built with the GNU C++ Standard Library in mind, and that is not present on my machine. I assume that it disappeared at some point in the past, possibly between Xcode 9.2 (which was the last version I was using) and Xcode 10.0. Is there a way to get it back?

John

Alex Zavatone via Groups.Io wrote on 20/9/18 21:24:

Did you change your linked library to the new C++ one?

On Sep 20, 2018, at 2:32 AM, John Brownie <john_brownie@sil.org> wrote:

After a hiatus of some months, I'm back to programming, and just got Xcode 10 installed. When I go to build, I get all kinds of changes suggested. I make some, but then I get stuck some that I cannot work out. My project is a mixture of Objective-C, Objective-C++, C++, and a little Swift (in a separate target).

When I start to build the first target, clang gives the the warning:
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]

OK, so I add a compiler flag as suggested, and I get the following warnings:
error: invalid value 'libc++' in '-std=libc++'
note: use 'c++98' or 'c++03' for 'ISO C++ 1998 with amendments' standard
note: use 'gnu++98' or 'gnu++03' for 'ISO C++ 1998 with amendments and GNU extensions' standard
note: use 'c++11' for 'ISO C++ 2011 with amendments' standard
note: use 'gnu++11' for 'ISO C++ 2011 with amendments and GNU extensions' standard
note: use 'c++14' for 'ISO C++ 2014 with amendments' standard
note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU extensions' standard
note: use 'c++17' for 'ISO C++ 2017 with amendments' standard
note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions' standard
note: use 'c++2a' for 'Working draft for ISO C++ 2020' standard
note: use 'gnu++2a' for 'Working draft for ISO C++ 2020 with GNU extensions' standard

Using one of those (c++11), brings me back to the first warning. And then the compiler can't find the standard library headers (e.g. <algorithm>), anyway.

One of the suggested changes was "Update C++ Standard Library", so I reverted to pre-changes and didn't make that change, which got me to the second set of warnings.

Anyone have an idea how to break out of this cycle?

John
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland


--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland

Join cocoa@apple-dev.groups.io to automatically receive all group messages.