ycm-core / ycmd

A code-completion & code-comprehension server
https://ycm-core.github.io/ycmd/
GNU General Public License v3.0
1.69k stars 764 forks source link

ycm for new gcc version in centos stream 8? #1732

Closed bethebest0622 closed 7 months ago

bethebest0622 commented 7 months ago

ycm worked very well in my centos stream 8.

but recently i want to use c++20, so i install the new gcc toolset.

the new gcc is on: /opt/rh/gcc-toolset-13/root/usr/include/c++/13

i added this path into .ycm_extra_conf.py

then i found the whole projected was full of error, one of the error is about std::string:

member reference base type 'const std::string' (aka 'const int') is not a structure or union

could you help on this? how can i got the new gcc ycm support?

bethebest0622 commented 7 months ago

more details, the string file has error: unknown type name '_GLIBCXX20_CONSTEXPR'

bstaletic commented 7 months ago

Next time, fill out the issue template, as it would have had you fill in the relevant info. We need the debug logs, the :YcmDebugInfo for now.

the new gcc is on: /opt/rh/gcc-toolset-13/root/usr/include/c++/13 i added this path into .ycm_extra_conf.py

That does not sound right. C++ compilers do not have a single system include path, so I bet your system headers are getting mixed up, but... debug info and logs.

EDIT: Apologies, I thought this was in the YouCompleteMe repo, which has the issue template.

puremourning commented 7 months ago

You probably need to add --gcc-toolchain /opt/rh/gcc-toolset-13/root/usr to your flags.

Closing because not a ycmd bug.