First, I'm not asking how to include includes in a syntastic check. I already have:

let g:syntastic_c_check_header = 1

And when I run :SyntasticCheck, or save, a .cpp file, it also checks relevant includes if they are in syntastic_c_include_dirs. It even opens an error location_list window in the buffer containing the .hpp if I then jump to it.

That's great, but what it won't do is check the header directly, whether I save it or use :SyntasticCheck in the .hpp buffer.

This means when working on template classes made only of an .hpp, I have to load some file that uses it and run the check from there; sometimes the easiest way to do this is to just create a dummy .cpp file with one line in it (#include "foo.hpp"). But this is still stupid and annoying.

Is anyone aware of a way to get Syntastic to check a C++ header directly, without having to run a check on file which uses the header?

  • 1
    Have you tried setting g:syntastic_cpp_check_header to 1 instead of g:syntastic_c_check_header?
    – lcd047
    Commented Sep 26, 2016 at 14:27
  • @lcd047 :/ I know that maybe qualifies this for "whoops, delete, ignore me..." but if you want to put it in an answer, please do.
    – goldilocks
    Commented Sep 26, 2016 at 14:33

1 Answer 1


But this is still stupid and annoying.

Or maybe that's just me. I had not noticed there's separate but similar options for C and C++.

let g:syntastic_cpp_check_header

Does the trick.

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.