vim安装youcompleteme失败了 大家帮帮忙把

Vim、Emacs配置和使用
回复
头像
qagkiss
帖子: 15
注册时间: 2012-10-09 22:17
系统: ubuntu

vim安装youcompleteme失败了 大家帮帮忙把

#1

帖子 qagkiss » 2014-01-30 21:07

If you DO care about semantic support for C-family languages, then yourcmake call will be a bit more complicated. We'll assume you downloaded abinary distribution of LLVM+Clang from llvm.org in step 3 and that youextracted the archive file to folder ~/ycm_temp/llvm_root_dir (with bin,lib, include etc. folders right inside that folder). With that in mind,run the following command in the ycm_build directory:
cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/cpp
Now that makefiles have been generated, simply run:
make ycm_support_libs
For those who want to use the system version of libclang, you would pass-DUSE_SYSTEM_LIBCLANG=ON to cmake instead of the-DPATH_TO_LLVM_ROOT=... flag.
You could also force the use of a custom libclang library with-DEXTERNAL_LIBCLANG_PATH=/path/to/libclang.so flag (the library would endwith .dylib on a Mac). Again, this flag would be used instead of theother flags.


以上是官方教程提供的步骤,我就是卡在这里的。。
问题如下,教程假设我已经下载了LLVM+Clang 并且把他放在了~/ycm_temp/llvm_root_dir文件夹里,所以他给出的编译命令如下
==》cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/cpp


但是我是通过apt-get 直接下载安装llvim clang的,所以我不知道如何修改这条命令,接下来我继续看,发现如下英文
For those who want to use the system version of libclang, you would pass-DUSE_SYSTEM_LIBCLANG=ON to cmake instead of the-DPATH_TO_LLVM_ROOT=... flag.
我的英文不太好,但是我的理解是,如果你想使用系统中存在的libclang版本,那么就用
-DUSE_SYSTEM_LIBCLANG=ON 来代替上面命令的 -DPATH_TO_LLVM_ROOT=...
所以我使用的命令如下
==》cmake -G "Unix Makefiles" -DUSE_SYSTEM_LIBCLANG=ON . ~/.vim/bundle/YouCompleteMe/cpp

但是却出错了 ,我单独把错误报告贴出来 ,大家帮帮我

-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is Clang 3.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/c++" is not able to compile a simple test
program.

It fails with the following output:

Change Dir: /home/tcstory/ycm_build/CMakeFiles/CMakeTmp



Run Build Command:/usr/bin/make "cmTryCompileExec595185650/fast"

/usr/bin/make -f CMakeFiles/cmTryCompileExec595185650.dir/build.make
CMakeFiles/cmTryCompileExec595185650.dir/build

make[1]: Entering directory `/home/tcstory/ycm_build/CMakeFiles/CMakeTmp'

/usr/bin/cmake -E cmake_progress_report
/home/tcstory/ycm_build/CMakeFiles/CMakeTmp/CMakeFiles 1

Building CXX object
CMakeFiles/cmTryCompileExec595185650.dir/testCXXCompiler.cxx.o

/usr/bin/c++ -o
CMakeFiles/cmTryCompileExec595185650.dir/testCXXCompiler.cxx.o -c
/home/tcstory/ycm_build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

Linking CXX executable cmTryCompileExec595185650

/usr/bin/cmake -E cmake_link_script
CMakeFiles/cmTryCompileExec595185650.dir/link.txt --verbose=1

/usr/bin/c++ CMakeFiles/cmTryCompileExec595185650.dir/testCXXCompiler.cxx.o
-o cmTryCompileExec595185650 -rdynamic

/usr/bin/ld: cannot find -lstdc++

clang: error: linker command failed with exit code 1 (use -v to see
invocation)

make[1]: *** [cmTryCompileExec595185650] Error 1

make[1]: Leaving directory `/home/tcstory/ycm_build/CMakeFiles/CMakeTmp'

make: *** [cmTryCompileExec595185650/fast] Error 2





CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:19 (project)


-- Configuring incomplete, errors occurred!
头像
lilydjwg
论坛版主
帖子: 4249
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: vim安装youcompleteme失败了 大家帮帮忙把

#2

帖子 lilydjwg » 2014-02-15 20:48

你的 c++ 编译器没有找到它需要的 C++ 标准库。
woainvzu
帖子: 100
注册时间: 2010-12-27 22:44

Re: vim安装youcompleteme失败了 大家帮帮忙把

#3

帖子 woainvzu » 2014-04-26 7:52

基于Linux平台的源码编译安装步骤: https://github.com/Marslo/VimConfig#com ... ource-code
基于Windows平台的源码编译步骤: https://github.com/Marslo/VimConfig#in-windws-by-cygwin
头像
Fermat618
帖子: 728
注册时间: 2008-12-28 16:01

Re: vim安装youcompleteme失败了 大家帮帮忙把

#4

帖子 Fermat618 » 2014-04-27 9:49

代码: 全选

sudo apt-get install vim-youcompleteme 
爱因斯坦会弹钢琴
爱因斯坦会拉小提琴
爱因斯坦会骑自行车
回复