Your C++ compiler does NOT fully support C++17
Asked Answered
F

4

9
Searching Python 3.6 libraries...                                  
Found Python library: /home/luan/anaconda3/envs/za/lib/libpython3.6m.so
Found Python headers folder: /home/luan/anaconda3/envs/za/include/python3.6m
-- The C compiler identification is GNU 7.5.0             
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc              
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info      
-- Detecting C compiler ABI info - done                               
-- Detecting C compile features            
-- Detecting C compile features - done                    
-- Check for working CXX compiler: /usr/bin/c++     
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info                 
-- Detecting CXX compiler ABI info - done                
-- Detecting CXX compile features          
-- Detecting CXX compile features - done       
CMake Error at CMakeLists.txt:232 (message):    
  **Your C++ compiler does NOT fully support C++17.**    
                                             
                                                
-- Configuring incomplete, errors occurred!
See also "/tmp/ycm_build_6b5ro8ju/CMakeFiles/CMakeOutput.log".
ERROR: the build failed.                
                                             
NOTE: it is *highly* unlikely that this is a bug but rather
that this is a problem with the configuration of your system
or a missing dependency. Please carefully read CONTRIBUTING.md
and if you're sure that it is a bug, please raise an issue on the
issue tracker, including the entire output of this script
and the invocation line used to run it.
Farah answered 14/12, 2020 at 6:31 Comment(1)
github.com/ycm-core/…: Our policy is to support the Vim version that's in the latest LTS of Ubuntu. That's currently Ubuntu 20.04… In order to provide the best possible performance and stability, ycmd has updated its code to C++17. This requires a version bump of the minimum supported compilers. The new requirements are: GCC 8 (you have 7.5).Epp
F
20

My solution: Install G++-8 (follow this answer https://askubuntu.com/a/1028656/987517)

sudo apt-get install g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
Farah answered 14/12, 2020 at 6:59 Comment(1)
Worked for me on Ubuntu 18.04Karlis
P
18

As an alternative to setting gcc-8 as the default compiler as done in the accepted answer you can also pass environment variables to the installation command of YouCompleteMe, like so:

CC=gcc-8 CXX=g++-8 python3 ./install.py

Then you don't need to update the default gcc, if that is not wanted.

Photogrammetry answered 12/4, 2021 at 12:48 Comment(1)
My system default gcc is 7, I installed gcc 8. But somehow the error still showed up. So I used CC=gcc CXX=g++ python3 ./install.pyPacha
D
3

If you're using centos, you should install devtoolset-8

see Developer Toolset 8

sudo yum install centos-release-scl
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
sudo yum install devtoolset-8
scl enable devtoolset-8 bash
Daisy answered 6/8, 2021 at 9:35 Comment(0)
P
1

If you happen to be using gcc installed using Homebrew, the steps are slightly different:

> brew install gcc@8
> brew unlink gcc
> brew link gcc@8

(Homebrew has other versions of gcc, you can run brew search gcc to see them all.)

Note that, even if the gcc in your PATH points to your system gcc (e.g., /usr/bin/gcc), a setup/install/make script running in a different environment may still be seeing your Homebrew version of gcc. This is what happened to me, and the steps in @Luan Pham's answer didn't work as a result!

Parnassus answered 9/1, 2021 at 22:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.