【问题标题】:Your C++ compiler does NOT fully support C++17您的 C++ 编译器不完全支持 C++17
【发布时间】:2020-12-14 06:31:02
【问题描述】:
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.

【问题讨论】:

  • github.com/ycm-core/…:我们的政策是支持 Ubuntu 最新 LTS 中的 Vim 版本。目前是 Ubuntu 20.04……为了提供最佳性能和稳定性,ycmd 已将其代码更新为 C++17。这需要最低支持的编译器的版本提升。新要求是:GCC 8(你有 7.5)。

标签: vim youcompleteme


【解决方案1】:

我的解决方案:安装 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

【讨论】:

    【解决方案2】:

    作为在the accepted answer 中将 gcc-8 设置为默认编译器的替代方法,您还可以将环境变量传递给 YouCompleteMe 的安装命令,如下所示:

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

    那么你不需要更新默认的gcc,如果不需要的话。

    【讨论】:

    • 我的系统默认 gcc 是 7,我安装了 gcc 8。但不知何故,错误仍然出现。所以我用CC=gcc CXX=g++ python3 ./install.py
    【解决方案3】:

    如果你碰巧是使用Homebrew安装的gcc,步骤略有不同:

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

    (Homebrew 有其他版本的 gcc,你可以运行brew search gcc 来查看它们。)

    请注意,即使您的 PATH 中的 gcc 指向您的系统 gcc(例如,/usr/bin/gcc),在不同环境中运行的 setup/install/make 脚本可能仍会看到您的 Homebrew 版本海湾合作委员会。这就是发生在我身上的事情,结果@Luan Pham 回答中的步骤不起作用!

    【讨论】:

      【解决方案4】:

      如果你使用的是centos,你应该安装devtoolset-8

      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
      

      【讨论】:

        猜你喜欢
        • 2020-12-17
        • 1970-01-01
        • 2010-10-14
        • 1970-01-01
        • 2014-11-05
        • 1970-01-01
        • 2019-07-16
        • 2018-01-13
        • 1970-01-01
        相关资源
        最近更新 更多