简体   繁体   English

您的 C++ 编译器不完全支持 C++17

[英]Your C++ compiler does NOT fully support C++17

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.

My solution: Install G++-8 (follow this answer https://askubuntu.com/a/1028656/987517 )我的解决方案:安装 G++-8 (按照这个答案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

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:作为在接受的答案中将 gcc-8 设置为默认编译器的替代方法,您还可以将环境变量传递给 YouCompleteMe 的安装命令,如下所示:

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

Then you don't need to update the default gcc , if that is not wanted.如果不需要,则无需更新默认gcc

If you happen to be using gcc installed using Homebrew , the steps are slightly different:如果您碰巧使用的是使用Homebrew安装的 gcc ,则步骤略有不同:

> 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.) (Homebrew 有其他版本的 gcc,你可以运行brew search gcc来查看它们。)

Note that, even if the gcc in your PATH points to your system gcc (eg, /usr/bin/gcc ), a setup/install/make script running in a different environment may still be seeing your Homebrew version of gcc.请注意,即使您的PATH中的gcc指向您的系统 gcc(例如/usr/bin/gcc ),在不同环境中运行的 setup/install/make 脚本可能仍会看到您的 Homebrew 版本的 ZE0D511CC966BD441230AFDC4。 This is what happened to me, and the steps in @Luan Pham's answer didn't work as a result!这就是发生在我身上的事情,结果@Luan Pham 回答中的步骤不起作用!

If you're using centos, you should install devtoolset-8如果你使用的是 centos,你应该安装 devtoolset-8

seeDeveloper Toolset 8请参阅开发人员工具集 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM