【问题标题】:can I install over clang-format-10 on ubuntu18.04我可以在 ubuntu18.04 上安装 clang-format-10
【发布时间】:2021-03-12 09:29:48
【问题描述】:

我想知道是否可以在 ubuntu 18.04 上安装 clang-format-10。 由于我必须使用 clang-format --dry-run 选项,所以我想知道

【问题讨论】:

    标签: clang-format


    【解决方案1】:

    您可以按照以下步骤在 Ubuntu 18.04 上安装 clang-format-10

    $ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
    $ echo 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' | sudo tee -a /etc/apt/sources.list
    $ echo 'deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' | sudo tee -a /etc/apt/sources.list
    $ sudo apt update
    $ sudo apt search 'clang-format'
    ...
    clang-format-10/unknown 1:10.0.1~++20210314110130+ef32c611aa21-1~exp1~20210314220728.205 amd64
      Tool to format C/C++/Obj-C code
    ...
    $ sudo apt install -y clang-format-10
    $ clang-format-10 --version
    Ubuntu clang-format version 10.0.1-++20210314110130+ef32c611aa21-1~exp1~20210314220728.205
    

    您也可以查看this answer了解更多详情。

    【讨论】:

    • 抱歉,我忘记添加评论了。多谢。太棒了!
    • 我还需要做一些事情:sudo apt install -y libllvm10 才能安装 clang-format-10,sudo ln -s /usr/bin/clang-format-10 /usr/bin/clang-format 安装 clang-format-10 之后
    猜你喜欢
    • 1970-01-01
    • 2014-01-12
    • 2019-01-13
    • 2016-10-22
    • 1970-01-01
    • 2018-06-02
    • 1970-01-01
    • 2013-12-30
    • 2019-06-28
    相关资源
    最近更新 更多