In XCode clang 11 I get: No template named 'initializer_list' in namespace 'std'

When someone on my team executes:

/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake .. -G Xcode

using XCode 10, and then opens the xcodeproj folder, Xcode starts and everything compiles.


In his project.pbxproj file are:

OTHER_CPLUSPLUSFLAGS = "-std=c++11 -pthread -fstrict-aliasing -Wall -Wcast-qual -Wextra -Wformat -Wpedantic -Wswitch-default -Wno-unknown-pragmas
OTHER_LDFLAGS = " -Wl,-search_paths_first -Wl,-headerpad_max_install_names  $HEAD/sdsp/metrics/test/build/sws-metrics/Release/libsws-metrics.a";


It does not do the same thing when I do this using:

Apple clang version 11.0.0 (clang-1100.0.33.17)

I get errors:

  • No template named 'initializer_list' in namespace 'std'
  • A space is required between consecutive right angle brackets (use '> >')


And my OTHER_ variables are blank. I tried setting these to be like his- it didn't help.

In the project I tried all the various options for

Apple Clang - Language
  C Language Dialect - Compiler Default, c11, gnu11
Apple Clang - Language - C++
  C++ Language Dialect - C++11 [-std=c++11] (and gnu11 and the 14 and 17's)
  C++ Standard Library - Compiler Default, libstdc++, libc++
Apple Clang - Warnings - C++
  Using C++11 extensions in earlier versions of C++ - was No and I tried that and Yes

Nothing works.


We both create the makefiles from the same folder with:

/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake .. -G Xcode

I also tried the 3.17.0 cmake I had in homebrew, and after upgrading it to 3.18.1. No difference.

Any idea what to do?


(I have an old XCode10.3, but it won't run- it tries to "install additional components" and fails...)

MacBook Pro 15″, macOS 10.14

Posted on Aug 14, 2020 9:53 AM

Reply

Similar questions

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

In XCode clang 11 I get: No template named 'initializer_list' in namespace 'std'

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.