解决xxx.h not found 头文件找不到, 然后满屏幕标红的问题
由于youcompleteme会禁用掉syntastic, 因此关闭YCM对C/C++的语法检查即可。
:SyntasticInfo
Syntastic version: 3.7.0-237 (Vim 704, Linux, GUI)
Info for filetype: c
Global mode: active
Filetype c is active
The current file will be checked automatically
Available checkers: gcc make
Currently enabled checker: gcc
Press ENTER or type command to continue
如果Currently enabled checker显示disabled by youcompleteme就在.vimrc
中加入下行
let g:ycm_show_diagnostics_ui = 0 "0表示禁用ycm自带的syntastic插件
通常syntastic会自动检查include,../include
在.vimrc
中加入:
let g:syntastic_c_config_file = '.syntastic_c_config'
let g:syntastic_cpp_config_file = '.syntastic_c_config'
那么需要在项目根目录下写个配置文件.syntastic_c_config。
每个文件夹占一行
-I yourlib/
-I yourlib/subdir