cd ~/.vim/bundle/YouCompleteMe/build
cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=$(find ~/.vim/bundle/color_coded/build -maxdepth 1 -type d -name 'clang*') . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
make -j4
编译出错的log 如下:
[ 76%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/TranslationUnit.cpp.o
/root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/ClangCompleter/TranslationUnit.cpp: In function 'unsigned int YouCompleteMe::{anonymous}::EditingOptions()':
/root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/ClangCompleter/TranslationUnit.cpp:42:10: error: 'CXTranslationUnit_CreatePreambleOnFirstParse' was not declared in this scope
CXTranslationUnit_CreatePreambleOnFirstParse |
^
/root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/ClangCompleter/TranslationUnit.cpp: In constructor 'YouCompleteMe::TranslationUnit::TranslationUnit(const string&, const std::vector<UnsavedFile>&, const std::vector<std::__cxx11::basic_string<char> >&, CXIndex)':
/root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/ClangCompleter/TranslationUnit.cpp:103:51: error: 'clang_parseTranslationUnit2FullArgv' was not declared in this scope
&clang_translation_unit_ );
^
ycm/CMakeFiles/ycm_core.dir/build.make:278: recipe for target 'ycm/CMakeFiles/ycm_core.dir/ClangCompleter/TranslationUnit.cpp.o' failed
make[2]: *** [ycm/CMakeFiles/ycm_core.dir/ClangCompleter/TranslationUnit.cpp.o] Error 1
CMakeFiles/Makefile2:142: recipe for target 'ycm/CMakeFiles/ycm_core.dir/all' failed
make[1]: *** [ycm/CMakeFiles/ycm_core.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
color_coded 使用了3.6 版本的clang。
系统clang 版本为3.8。
使用系统clang 编译成功,编译方法为:
使用color_coded 下载的clang 编译出错,编译方法为:
编译出错的log 如下: