我正在尝试在 Ubuntu 15.10 上安装带有补丁1-712的 Vim 7.4 的 YouCompleteMe。
我手动编译了 YouCompleteMe,因为我遇到了如下错误:
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
如常见问题部分所述,添加-DPYTHON_LIBRARY=/usr/lib/libpython2.7.so
将解决它。因此,改为编译它:
cmake -G "Unix Makefiles" -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
然后:
cmake --build . --target ycm_support_libs --config Release
这次编译时我没有遇到任何错误,但是当我打开 Vim I 时,我看到的是:
import ycm_client_support
ImportError: /home/austin/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_support.so: undefined symbol: PyUnicodeUCS2_AsWideChar
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line 33:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line 33:
File "<string>", line 29, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line 33:
File "/home/austin/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 32, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line 33:
from ycm.omni_completer import OmniCompleter
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line 33:
File "/home/austin/.vim/bundle/YouCompleteMe/autoload/../python/ycm/omni_completer.py", line 22, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line 33:
from ycmd.completers.completer import Completer
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPyth
on:
line 33:
File "/home/austin/.vim/bundle/YouCompleteMe/autoload/../third_party/ycmd/ycmd
/completers/completer.py", line 25, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPyth
on:
line 33:
from ycm_client_support import FilterAndSortCandidates
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPyth
on:
line 33:
ImportError: /home/austin/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_
support.so: undefined symbol: PyUnicodeUCS2_AsWideChar
有谁知道如何解决这一问题?