I'm working with a C++ project and trying to configure it to use syntastic. In my project I have a nested directory structure of header files (The actual nested structure is much worse, this is an example).
--libs
|---dir1
|---foo1.h
|---dir2
|---foo2.h
|---foo3.h
|---dir3
|---foo4.h
I have included the lib files in my .vimrc file using:
let g:syntastic_cpp_include_dirs = [ 'libs/']
I assumed this would take all the header files recursively, but it doesn't. In the code, syntastic complains with the error 'no such file or directory found'.
When I explicitly change the variable to refer to a specific directory:
let g:syntastic_cpp_include_dirs = [ 'libs/dir2/dir3/']
it works.
My questions:
- How do you configure syntastic so that it includes header files of a set of directories recursively?
- How do you do this for multiple projects? Always editing the .vimrc as I switch the project I'm working on doesn't sound right. I believe there must be a better way.
EDIT:
I didn't mention that in my .vimrc, the following options are present for syntastic:
let g:syntastic_check_on_open=1
let g:syntastic_enable_signs=1
let g:syntastic_cpp_include_dirs = ['libs/dir2/dir3', 'libs/dir2 ]
let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_remove_include_errors = 1