4

我正在尝试在我的 emacs 中安装 flycheck-google-cpplint。但我得到这个错误:

(flycheck-mode 1)
(eval-after-load 'flycheck
  '(progn
     (require 'flycheck-google-cpplint)
     (flycheck-add-next-checker 'c/c++-cppcheck
                              'c/c++-googlelint 'append)))
(custom-set-variables
   '(flycheck-googlelint-verbose "3")
   '(flycheck-googlelint-filter "-whitespace,+whitespace/braces"))

但这不起作用。我收到以下错误:

Error: (user-error "Configured syntax checker c/c++-googlelint cannot be used") 

我不知道为什么。我安装了 cpplint,如果我从命令行使用它,它工作正常。有什么建议吗?

4

1 回答 1

4

flycheck-google-lint 使用 cpplint。您必须告诉 emacs 在哪里可以找到 cpplint.py 可执行文件才能运行语法检查。

您可以在此处找到 cpplint 文件。

然后,您需要将其添加到您的 init emacs 文件中:

(custom-set-variables
 '(flycheck-c/c++-googlelint-executable "/path/to/cpplint.py"))
于 2014-07-14T18:21:03.603 回答