【问题标题】:ncurses not found when trying to build vim尝试构建 vim 时未找到 ncurses
【发布时间】:2016-04-14 01:57:50
【问题描述】:

最近升级到 Fedora 23 后,我正在尝试在我的用户目录中构建 vim

我有 ncurses 和 ncurses-devel

[root@statquant-laptop lib]# dnf install ncurses
Last metadata expiration check performed 1:09:48 ago on Sat Jan  9 10:33:06 2016.
Package ncurses-5.9-21.20150214.fc23.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

[root@statquant-laptop lib]# dnf install ncurses-devel
Last metadata expiration check performed 1:09:58 ago on Sat Jan  9 10:33:06 2016.
Package ncurses-devel-5.9-21.20150214.fc23.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

证明如下:

[root@statquant-laptop lib]# ll /usr/lib/libncurs*
lrwxrwxrwx. 1 root root     17 Jun 17  2015 /usr/lib/libncurses.so.5 -> libncurses.so.5.9
lrwxrwxrwx. 1 root root     19 Jun 17  2015 /usr/lib/libncurses++.so.5 -> libncurses++.so.5.9
-rwxr-xr-x. 1 root root 154448 Jun 17  2015 /usr/lib/libncurses.so.5.9
-rwxr-xr-x. 1 root root  68176 Jun 17  2015 /usr/lib/libncurses++.so.5.9
lrwxrwxrwx. 1 root root     20 Jun 17  2015 /usr/lib/libncurses++w.so.5 -> libncurses++w.so.5.9
lrwxrwxrwx. 1 root root     18 Jun 17  2015 /usr/lib/libncursesw.so.5 -> libncursesw.so.5.9
-rwxr-xr-x. 1 root root  68176 Jun 17  2015 /usr/lib/libncurses++w.so.5.9
-rwxr-xr-x. 1 root root 216000 Jun 17  2015 /usr/lib/libncursesw.so.5.9
[root@statquant-laptop lib]# ll /usr/lib64/libncurs*
-rw-r--r--. 1 root root 330362 Jun 17  2015 /usr/lib64/libncurses.a
-rw-r--r--. 1 root root 183214 Jun 17  2015 /usr/lib64/libncurses++.a
-rw-r--r--. 1 root root 473398 Jun 17  2015 /usr/lib64/libncurses_g.a
-rw-r--r--. 1 root root 183214 Jun 17  2015 /usr/lib64/libncurses++_g.a
-rw-r--r--. 1 root root     31 Jun 17  2015 /usr/lib64/libncurses.so
lrwxrwxrwx. 1 root root     17 Jun 17  2015 /usr/lib64/libncurses++.so -> libncurses++.so.5
lrwxrwxrwx. 1 root root     17 Jun 17  2015 /usr/lib64/libncurses.so.5 -> libncurses.so.5.9
lrwxrwxrwx. 1 root root     19 Jun 17  2015 /usr/lib64/libncurses++.so.5 -> libncurses++.so.5.9
-rwxr-xr-x. 1 root root 155056 Jun 17  2015 /usr/lib64/libncurses.so.5.9
-rwxr-xr-x. 1 root root  76968 Jun 17  2015 /usr/lib64/libncurses++.so.5.9
-rw-r--r--. 1 root root 183214 Jun 17  2015 /usr/lib64/libncurses++w.a
-rw-r--r--. 1 root root 433400 Jun 17  2015 /usr/lib64/libncursesw.a
-rw-r--r--. 1 root root 183214 Jun 17  2015 /usr/lib64/libncurses++w_g.a
-rw-r--r--. 1 root root 593812 Jun 17  2015 /usr/lib64/libncursesw_g.a
lrwxrwxrwx. 1 root root     18 Jun 17  2015 /usr/lib64/libncurses++w.so -> libncurses++w.so.5
-rw-r--r--. 1 root root     32 Jun 17  2015 /usr/lib64/libncursesw.so
lrwxrwxrwx. 1 root root     20 Jun 17  2015 /usr/lib64/libncurses++w.so.5 -> libncurses++w.so.5.9
lrwxrwxrwx. 1 root root     18 Jun 17  2015 /usr/lib64/libncursesw.so.5 -> libncursesw.so.5.9
-rwxr-xr-x. 1 root root  76968 Jun 17  2015 /usr/lib64/libncurses++w.so.5.9
-rwxr-xr-x. 1 root root 208400 Jun 17  2015 /usr/lib64/libncursesw.so.5.9

当我运行./configure:

./configure --with-features=huge \
            --enable-fail-if-missing \
            --enable-luainterp=yes \
            --enable-mzschemeinterp \
            --enable-perlinterp \
            --enable-pythoninterp=yes \
            --with-python-config-dir=/usr/lib64/python2.7/config \
            --enable-python3interp=yes \
            --enable-tclinterp=yes \
            --enable-rubyinterp=yes \
            --enable-cscope \
            --enable-multibyte \
            --enable-gui=gtk2 \
            --prefix=$HOME/Build/vim

我明白了

checking for tgetent in -lcurses... no
no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
      You need to install a terminal library; for example ncurses.
      Or specify the name of the library with --with-tlib.

我能做什么?

【问题讨论】:

  • 你试过--with-tlib吗?
  • 我应该放什么? --with-tlib=/usr/lib/libncurses.so ?这个我试过了
  • 不是说你不应该在你的主目录中构建 vim,而是有什么理由不只使用已经有的 Vim?

标签: vim build configure ncurses fedora-23


【解决方案1】:

我在 Fedora23 上遇到了同样的问题。这是我的解决方案:

  1. 确保您已安装 ncurses-devel
  2. CFLAGS=-fPIC ./configure --with-tlib=ncurses and your_options

我检查了config.log,发现gcc抱怨缺少'-fPIC'

【讨论】:

  • 它工作了,但现在我不能make install 虽然我猜这个问题已经回答了
  • 我安装了ncurses-devel,我的问题解决了。
  • # yum install ncurses-devel 加载的插件:priorities, update-motd, upgrade-helper 软件包 ncurses-devel-5.7-4.20090207.14.amzn1.x86_64 已经安装和最新版本无事可做.. ......仍然出现错误:# make gcc -fPIC -I/usr/local/include -Wall -DOMNITTY_VERSION=\"0.3.0\" -o omnitty minibuf.o machine.o menu.o machmgr.o help.o main.o curutil.o -L/usr/local/lib -lrote /usr/bin/ld: menu.o: undefined reference to symbol 'delwin' /lib64/libncurses.so.5: 添加符号时出错:命令行collect2中缺少DSO:错误:ld返回1退出状态make:*** [omnitty]错误1
【解决方案2】:

您显然没有安装 ncurses 的开发包。在 Fedora23 上,这将是 ncurses-devel,例如,ncurses-devel-5.9-21.20150214.fc23.x86_64

没有它,您只有 runtime 库(这是必需的)。

一旦你有了它,vim 7.4 的配置将显示如下:

checking --with-tlib argument... empty: automatic terminal library selection
checking for tgetent in -ltinfo... yes
checking whether we talk terminfo... yes
checking what tgetent() returns for an unknown terminal... zero
checking whether termcap.h contains ospeed... yes
checking whether termcap.h contains UP, BC and PC... yes
checking whether tputs() uses outfuntype... no

进一步阅读:

【讨论】:

  • 你检查过我做了 dnf install ncurses-devel 吗?
  • 我明白了——但你没有提到你正在尝试构建的 vim 版本,也没有提到 src/auto/config.log 对你的配置的说明。您也没有显示开发包的结果,而只是列出了运行时的一部分。配置脚本需要用于 vim 的 libtinfo.so - 而不是 libncurses.so
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-01-22
  • 1970-01-01
  • 2020-04-06
  • 2022-11-08
  • 1970-01-01
  • 2021-10-07
相关资源
最近更新 更多