- ERROR - /home/admin/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so: undefined symbol: clang_getCompletionFixIt
Traceback (most recent call last):
File "/home/admin/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py", line 639, in ImportAndCheckCore
ycm_core = ImportCore()
File "/home/admin/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py", line 630, in ImportCore
import ycm_core as ycm_core
ImportError: /home/admin/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so: undefined symbol: clang_getCompletionFixIt
解決辦法:在YouCompleteMe目錄下運作install.sh
cd ~/.vim/bundle/YouCompleteMe
./install.sh
這裡可能會報錯,是關于python版本的問題,隻需要将install.sh裡的python/python2全部改成python3即可。
#!/bin/sh
echo "WARNING: this script is deprecated. Use the install.py script instead." 1>&2
SCRIPT_DIR=$(dirname $0 || exit $?)
command_exists() {
command -v "$1" >/dev/null 2>&1 ;
}
PYTHON_BINARY=python3
if command_exists python3; then
PYTHON_BINARY=python3
fi
$PYTHON_BINARY "$SCRIPT_DIR/install.py" "$@" || exit $?
此外不建議在./install.sh 後追加 --clang-completer --system-libclang,追加後在使用vim的時候YCM失效。
參考連結:
https://blog.csdn.net/weixin_30832351/article/details/99106253
http://www.mamicode.com/info-detail-2710530.html