0

I can't find the reason for this compilation error:

The #include file <initializer_list> is not found

I'm compiling with c++11 flag: qlanglvl=extended0x The version of xlc++ is 16.1 in aix 7.2

Can anyone help me?

Many thanks.

Jason
  • 36,170
  • 5
  • 26
  • 60
Antonio
  • 91
  • 1
  • 7
  • Have you checked if that compiler supports all of C++11? – Jesper Juhl Mar 16 '23 at 12:18
  • Yes, in theory, Initializer lists are supported from the version: started in 13.1 – Antonio Mar 16 '23 at 12:24
  • 1
    I don't know anything about your compiler, but perhaps it intends you to include `utility` instead? – AndyG Mar 16 '23 at 13:39
  • Is the compiler able to find other headers, just not this one? It's possible that your installation is messed up a little bit or your include paths are not correct. – AndyG Mar 16 '23 at 13:49
  • import works, but now I have another compilation error :( Error: An initializer is not allowed here. When I try to use std::initializer_list as function parameter... – Antonio Mar 16 '23 at 15:14

1 Answers1

3

Not all of C++11 is implemented in xlC V16.1. There is an xlclang++ compiler in V16.1 that supports all of C++11.