ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.36k stars 2.8k forks source link

reference to 'std' is ambiguous? #4202

Closed bethebest0622 closed 6 months ago

bethebest0622 commented 7 months ago

I am using centos 8, vim 9 with up-to-date ycm.

it worked perfectly.

but when i want to use new gcc version, there is something wrong.

I need to use c++20 coroutinue, but my os gcc is not so new, the path is/usr/include/c++/8/iostream

so i install the new gcc, the path is: /opt/rh/gcc-toolset-13/root/usr/include/c++/13/iostream

so i add the path in flags

flags = [
......
'-isystem',
'/opt/rh/gcc-toolset-13/root/usr/include/c++/13'
]

Then, i found something messed up, even the basic code like this:

#include <iostream>
#include <coroutine>

int main() {
  std::cout << "hello world" << std::endl;
}

failed, the warning message is: reference to 'std' is ambiguous

could you help on this? how to let new gcc work well?

thanks

bstaletic commented 7 months ago

We will need the ycmd logs and the debug info to even begin analyzing this.

My guess is that your c++ completer is mixing up system header include paths.