我尽力按照github https://github.com/VundleVim/Vundle.vim#about
以及https://github.com/Valloric/ycmd
当我在目录./install.py --clang-completer --system-libclang
下输入YouCompleteMe
时,会出现以下错误
Undefined symbols for architecture x86_64:
"_clang_parseTranslationUnit2FullArgv", referenced from:
YouCompleteMe::TranslationUnit::TranslationUnit(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<UnsavedFile, std::__1::allocator<UnsavedFile> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, void*) in TranslationUnit.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/Users/cengcengruihong/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so] Error 1
make[2]: *** [ycm/CMakeFiles/ycm_core.dir/all] Error 2
make[1]: *** [ycm/CMakeFiles/ycm_core.dir/rule] Error 2
make: *** [ycm_core] Error 2
Traceback (most recent call last):
File "/Users/cengcengruihong/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 371, in BuildYcmdLib
subprocess.check_call( build_command )
File "/Users/cengcengruihong/anaconda/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['cmake', '--build', '.', '--target', 'ycm_core', '--', '-j', '4']' returned non-zero exit status 2
ERROR: The build failed.
NOTE: It is *highly* unlikely that this is a bug but rather
that this is a problem with the configuration of your system
or a missing dependency. Please carefully read CONTRIBUTING.md
and if you're sure that it is a bug, please raise an issue on the
issue tracker, including the entire output of this script
and the invocation line used to run it.
Traceback (most recent call last):
File "./install.py", line 44, in <module>
Main()
File "./install.py", line 33, in Main
subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
File "/Users/cengcengruihong/anaconda/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/cengcengruihong/anaconda/bin/python', u'/Users/cengcengruihong/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py', '--clang-completer', '--system-libclang']' returned non-zero exit status 1
我在计算机上安装了xcode
。我用谷歌搜索了错误,但我找不到最相关的错误。
答案 0 :(得分:0)
这是因为system-libclang的版本低于YCM要求。
您可以直接使用./install.py --clang-completer
,YCM会自动下载所需的铿锵声。
YCM也不建议使用system-libclang。