vim YouCompleteMe 遇到的问题及解决
Posted yang68h
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vim YouCompleteMe 遇到的问题及解决相关的知识,希望对你有一定的参考价值。
问题1:
补充,升级gcc,g++ 到4.7以上的版本才能安装成功
github 官网
github https://github.com/Valloric/YouCompleteMe#ubuntu-linux-x64
问题2:
./install.py --clang-completer
Using Clang archive: /root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/../clang_archives/clang+llvm-3.9.0-x86_64-opensuse13.2.tar.xz
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
CMake Error at ycm/CMakeLists.txt:164 (message):
You have not specified which libclang to use. You have several options:
1. Set PATH_TO_LLVM_ROOT to a path to the root of a LLVM+Clang binary distribution. You can download such a binary distro from llvm.org. This is the recommended approach.
2. Set USE_SYSTEM_LIBCLANG to ON; this makes YCM search for the system version of libclang.
3. Set EXTERNAL_LIBCLANG_PATH to a path to whatever libclang.[so|dylib|dll] you wish to use.
You HAVE to pick one option. See the docs for more information.
这个错误是现在下来的/root/.vim/bundle/YouCompleteMe/third_party/ycmd/clang_archives/clang+llvm-3.9.0-x86_64-opensuse13.2.tar.xz 的clang_archives目录要放入/root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/llvm 目录下,也可以做一个软连接
vim /root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/CMakeLists.txt
新开第一行:
set (PATH_TO_LLVM_ROOT "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/llvm")
这个方法解决后发现自动补全受到影响,又重新编译了,即./install.py 没用加任何参数,我不需要cfailmy
下面这个方法试了没用 https://github.com/Valloric/YouCompleteMe/issues/1237
I‘ve tried to add the following lines to the top of .vim/bundle/YouCompleteMe/third_party/ycmd/cpp/CMakeLists.txt
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
But it ends the same.
以上是关于vim YouCompleteMe 遇到的问题及解决的主要内容,如果未能解决你的问题,请参考以下文章
兼容 Vim 的 JS 检查器(Syntastic | YouCompleteMe)?
vim配置python编程环境及YouCompleteMe的安装教程