首页 > 开发 > C++ > 正文

gVim下You complete me插件配置失败报错【error 2】

2017-09-11 21:19:11  来源: 网友分享

最近我照着https://www.zhihu.com/questio...上的教程安装YCM(You complete me)这个vim上的自动补全插件。我将下载来的ycm的已编译包放在:
D:\packs\YouCompleteMe
把配置的python脚本放在:
C:\.ycm_extra_conf.py
我的vimrc片段是这样的:

"-----------------------ycm(You complete me)"这里的YCM是知乎上打包发的已编译版本set runtimepath+=D:\packs\YouCompleteMelet g:ycm_global_ycm_extra_conf = 'C:\.ycm_extra_conf.py'let g:ycm_confirm_extra_conf = 0let Python27="C:\Python27"let $PYTHONPATH=Python27."DLLs;".Python27."Lib;".Python27."Lib/lib-tk;".Python27."Lib/plat-win;".Python27."Lib/site-packages"

我的py脚本是这样的(部分):

import osimport ycm_core#get到环境变量devcpppath=os.environ["devcpppath"]# These are the compilation flags that will be used in case there's no# compilation database set (by default, one is not set).# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.flags = ['-Wall','-Wextra','-Werror','-fexceptions','-DNDEBUG',# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which# language to use when compiling headers. So it will guess. Badly. So C++# headers will be compiled as C headers. You don't want that so ALWAYS specify# a "-std=<something>".# For a C project, you would set this to something like 'c99' instead of# 'c++11'.'-std=c++11',# ...and the same thing goes for the magic -x option which specifies the# language that the files to be compiled are written in. This is mostly# relevant for c++ headers.# For a C project, you would set this to 'c' instead of 'c++'.'-x','c++','-isystem','/usr/include','-isystem','/usr/local/include','-isystem','/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1','-isystem','/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include','-isystem', devcpppath+'/MinGW64/include', '-isystem', devcpppath+'/MinGW64/x86_64-w64-mingw32/include', '-isystem', devcpppath+'/MinGW64/lib/gcc/x86_64-w64-mingw3/4.8.1/include', '-isystem', devcpppath+'/MinGW64/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++', ]

我是用devc++编程的OI选手,devcpppath是devc++的安装路径的环境变量。我使用它自带的MinGW。
然而,打开vim后显示:

查询百度和查询google均无果,有人碰到与我相同的问题吗?希望有人来帮忙!!

解决方案

呵呵,调了4天最终放弃gvim,改用qt去了。此问题终结~