https://github.com/Valloric/YouCompleteMe/issues/2885
You are getting these errors because the order of your -isystem flags is wrong: /usr/include/c++/7.2.1
must be included before /usr/include
. Try the following .ycm_extra_conf.py file:
def FlagsForFile( filename ):
return { 'flags': [
'-Wall',
'-Wextra',
'-Werror',
'-std=c++11',
'-x', 'c++',
'-isystem', '/usr/include/c++/7.2.1',
'-isystem', '/usr/include/c++/7.2.1/x86_64-pc-linux-gnu',
'-isystem', '/usr/include/c++/7.2.1/backward',
'-isystem', '/usr/local/include',
'-isystem', '/usr/include',
] }