c++补全出错(spacemacs)

配置文件

    (auto-completion :variables
                      auto-completion-enable-sort-by-usage t
                      auto-completion-enable-snippets-in-popup t
                      :disabled-for org markdown)
   (c-c++ :variables
      c-c++-default-mode-for-headers 'c++-mode
      c-c++-enable-clang-support t)

出现错误:

clang failed with error 1:
/usr/bin/clang -fsyntax-only -Xclang -code-completion-macros -x c++ -Xclang -code-completion-at=-:250:8 -

clang存在

> ls /usr/bin/clang
lrwxrwxrwx 1 root root 18 Jul 10 22:21 /usr/bin/clang -> /usr/bin/clang-4.0

错误消息提示的不是没有clang,而是clang命令运行失败(返回值是-1),你手动运行那个命令能成功吗? /usr/bin/clang -fsyntax-only -Xclang -code-completion-macros -x c++ -Xclang -code-completion-at=-:250:8 -

如果加上最后 -,貌似处于运行状态;如果去掉提示clang: error: no input files

不知道为什么,c++状态下连变量都没有补全

加上 - 再把补全的文件 pipe 进去试试。