Vim YouCompleteMe Mac OS C family 系统库函数不能自动补全
来源:互联网 发布:csdn黑马程序员 编辑:程序博客网 时间:2024/06/06 06:47
之前还好好的,升级Xcode 和 command tools 后突然发现 YouCompleteMe 不能对c 语言库函数(printf 等)自动补全了,以及出现对 NULL
等 宏定义提示未定义等情况,折腾了一上午,各种搜索,最终还是在官方文档上找到了答案,在此记录一下, 也希望能帮助其他遇到这个问题的人。
- 确认
.ycm_extra_conf.py
路径时候配对了:- let g:ycm_global_ycm_extra_conf=’/your_path/.ycm_extra_conf.py’
- 确认
.ycm_extra_conf.py
路径配置没有问题,那么再检查一下.ycm_extra_conf.py
文件内容时候有问题(因为有时候不小心按了一下键盘导致内容发生改变,我就翻过一次这样错误,在flags 列表里面添加path 的时候少些了一个逗号,导致自动补全失败,最好的方式就是和官方最新的文件用对比工具比较一下,看看时候有改动)。 如果以上问题都确认,并排除,那试试官方给出的方法,也就是今遇到问题的解决方法:
Completion doesn’t work with the C++ standard library headersThis is caused by an issue with libclang that only affects some operating systems. Compiling with clang the binary will use the correct default header search paths but compiling with libclang.so (which YCM uses) does not.
Mac OS X is normally affected, but there’s a workaround in YCM for that specific OS. If you’re not running that OS but still have the same problem, continue reading.
The workaround is to call echo | clang -v -E -x c++ - and look at the paths under the #include <…> search starts here: heading. You should take those paths, prepend -isystem to each individual path and append them all to the list of flags you return from your FlagsForFile function in your .ycm_extra_conf.py file.
在terminal 里面输入:
echo | clang -v -E -x c++ -
:
把红框里面的的路径全部添加的
.ycm_extra_conf.py
的 flag 列表里面:
注意:最后一行是以逗号
,
结尾的.最后:不管遇到什么问题查阅官方文档可能是快的解决问题方式
- Vim YouCompleteMe Mac OS C family 系统库函数不能自动补全
- mac os上的vim自动补全插件YouCompleteMe的安装过程
- VIM 自动补全YouCompleteME
- 【环境配置】VIM 安装YouCompleteMe自动补全插件(MAC)
- Mac 安装Vim自动补全插件(YouCompleteMe)
- mac vim 下安装自动补全插件YouCompleteMe
- Vim自动补全神器–YouCompleteMe
- Vim自动补全神器:YouCompleteMe
- Vim自动补全神器:YouCompleteMe
- Vim自动补全神器–YouCompleteMe
- Vim自动补全插件----YouCompleteMe
- Vim自动补全神器:YouCompleteMe+Syntastic
- YouCompleteMe实现vim自动补全
- Vim自动补全神器–YouCompleteMe
- Vim自动补全神器:YouCompleteMe
- Vim自动补全神器:YouCompleteMe
- Vim自动补全神器–YouCompleteMe
- Vim 自动补全神器-YouCompleteMe
- 计蒜客 16955 Islands(2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 F)
- mysql常用代码
- mysql存储过程详细教程
- 轻量级web server Tornado代码分析
- Android开发之时间选择器
- Vim YouCompleteMe Mac OS C family 系统库函数不能自动补全
- Android
- SPI子系统分析之四:驱动模块
- protobuf的Required,Optional,Repeated限定修饰符
- 冒泡排序之java数组实现
- C++中 变量y0y1等变量 的冲突问题
- LeetCode-627. Swap Salary
- http与https区别及https是如何保障安全性
- swift xxxfile no find / bridging no exit