本人的作業系統環境centos 6.6在安裝vim的YCM插件時發生錯誤。
vim為自己編譯,已加入對應的解釋語言支援。
系統自帶的python版本為2.6,本人編譯添加了2.7以及3.4版本,所以本人的環境中有這三個版本。
進入YCM目錄,執行指令安裝時,出現的錯誤如下:
[ 90%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/Result.cpp.o
Linking CXX shared library /home/xuanyuan/k-vim/bundle/Youletete/aclird_lecm/xuany/k-vim/bundle/Youlete/Meclird_lecm/i/x
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared dobject; #/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: 錯誤:ld 回傳1
gmake[3]:
* [/home/ xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_support.so] 錯誤1gmake[2]:
* [ycm/CMakeFiles/ycm_client_support.dir/all] 錯誤2gmake[1]:
* [ycm/CMakeFiles/ycm_support_libs.dir/rule] 錯誤2gmake:
* [ycm_support_libs] 錯誤2Traceback (most recent call last):
File "/home/xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 327, in <module>
Main()
File "/home/xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 316, in Main
BuildYcmdLibs( args )
File "/home/xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 261, in BuildYcmdLibs
subprocess.check_call( build_command )
File "/usr/local/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'ycm_support_libs', '--', '-j', '1']' returned non-zero exit status 2Traceback (most recent call last):
File "./install.py", line 32, in <module>
Main()
File "./install.py", line 21, in Main#
subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
File "/usr/local/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/bin/python', '/home/xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/build.py']' returned non-zero exit status 1求解決辦法?
phpcn_u15822017-05-16 16:39:45
已解決:
第一步:缺少python2.7的共享函式庫,重新編譯安裝python2.7加入編譯選項--enable-shared。
如果問題解決,不需要執行以下步驟,如果出現以下錯誤:
可能由於多個版本的python導致,以下錯誤:
python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
出現這種錯誤的解決辦法:
第二步:
編輯/etc/ld.so.conf文件,新加入以下內容/usr/local/lib,直接添加新的一行即可。
儲存後,執行以下指令( ---> 為指令提示符,每個人可以依照需求自行設定):
---> /sbin/ldconfig
---> /sbin/ldconfig –v