search

Home  >  Q&A  >  body text

linux - Ubuntu下编译Vim8(+python)无数次编译失败

因为想用YouCompleteMe,又希望vim带python2,所以ubuntu软件库里的默认的vim就不合适了,就找到了github上的vim源文件下载了下来,按照YouCompleteMe里的一片文章来编译,不知道是不是欺负我不懂Makefile,总之就报些全(stackoverflow)世(baidu)界(bing)都说不对的错误;几乎崩溃的我只想说:我就只是想用个喜欢的编辑器……

这是YouCompleteMe推荐我看的源码编译vim攻略

以上都只是前因,现在感觉已经不是这个问题了。我为了自己编译安装vim已经花了一天时间了,然而问题出在哪里都不知道。之前用

export CFLAGS="-pthread"

解决过下面这个问题

/usr/bin/ld: /usr/local/lib/libpython2.7.a(thread.o): undefined reference to symbol 'sem_post@@GLIBC_2.2.5'

这个时候我的./configure只设置了--enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.7/config,之前成功安装后发现没有成功把python编译进去,所以装第二次,又出现这个问题的时候,之前那个办法已经不管用了,也不知道是为啥;后来只把python3有关的选项去掉,其他的全都编译进vim,又出现了如下问题:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgio-2.0.so: undefined reference to symbol 'inflateInit2_'

stackoverflow、segmentfault和少部分csdn博客都翻过了,自己尝试解决问题然而解决不了。
这个问题怎么办才好?增加gcc参数可以用export CFLAGS这种形式吗?还是要改Makefile?我已经完全晕了因为根本就不知道这个问题到底是哪里出来的……

ringa_leeringa_lee2777 days ago737

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-18 10:25:01

    My compilation is successful, the command line of ./configure I use is

    ./configure --enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.7

    Then I used make and it was successful,

    Tips in the middle, I don’t have a function that can support the function tgetenv
    This function is found in libncurses5-dev

    sudo apt-get install libncurses5-dev

    These did the trick.

    Judging from your error, the real reason is that there is no libz development package in the system. It is recommended that you install the zlib1g-dev package.

    Also a reminder, you have been searching for a long time without using Google, this is the right way. Those two search engines are really not good.
    My solutions are all solved by Google. Although I am blocked, finding a ladder is a necessary skill for coders.

    reply
    0
  • Cancelreply