I am following this tutorial

When having enabled company-node upon typing for instance std::vec I get error message in the mini buffer saying:

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

However when I type just vec and then hit tab, I get a correct completion to std::vector<Class> var(10, Class());

Any idea what might be going wrong with clang here?

1 Answer 1


I had this error recently, too. I think you could solve it with some clang-flags in the company-clang-arguments user option. You have to specify your Include-Paths and the Library-Paths and link the required libraries. Here it's the standard-library, so you have to edit company-clang-executable from clang to clang++! But i use Atila Neves' c-make-ide. I can recommend that. You have to write a CMakeLists.txt and specify here the include-paths and libs. Then call cmake-ide-setup and everything is configured. I call it via hook.


  • Where do I find the company-clang-arguments user option? Aug 14, 2016 at 18:15
  • First it might be rather company-clang-executable! Change that to clang++. And you find it by M-x apropos, then company-clang and click on edit. Or you can change it in your init-file.
    – user12841
    Aug 14, 2016 at 20:43
  • I tried it and it worked. Let me know if it works at you.
    – user12841
    Aug 14, 2016 at 21:03
  • I changed ` (executable-find "clang)` to ` (executable-find "clang++")` in company-clang.el and that made it work. Not sure if that is what you meant, but thanks anyway! Aug 17, 2016 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.