Cygwin/VIM配置:缺少终端库(例如ncurses)



我已经为这个问题工作了6个小时,但我仍然无法计算出比我现在的命令更多的东西(在网上查看了解决方案和其他有这个问题的穷人的答案后)。

我尝试在安装了python3和mingw32的Windows+Cygwin上构建vim编辑器(默认命令为g++、c++……都引用了特定命令,如"i686-w64-mingw32-c++")

和许多其他人一样,我也遇到了一个错误,即缺少一个终端库(例如ncurses)。

在尝试配置vim项目很多小时之后,我仍然被卡住了。我已经尝试过:

  • 将工具链更改为cygwin包(切换回自定义的mingw32安装)
  • 安装了不同版本的ncurses(库被复制到不同的位置,如/usr/lib/usr/lib/lib)
  • 编写了/多次以不同方式配置命令

我当前的配置语句:

LD_LIBRARY_PATH=/cygdrive/d/developtools/mingw32/lib ./configure 
--with-features=huge 
--enable-multibyte 
--enable-python3interp=yes 
--with-python3-config-dir=/usr/lib/python3.6/config-3.6m-x86_64-cygwin 
--enable-cscope 
--with-tlib=ncurses

我当前config.log文件的一部分

configure:11342: result: no
configure:11348: checking --with-tlib argument
configure:11357: result: ncurses
configure:11360: checking for linking with ncurses library
configure:11373: gcc -o conftest.exe -g -O2   -L/usr/local/lib conftest.c  -lncurses >&5
configure:11373: $? = 0
configure:11374: result: OK
configure:11477: checking for tgetent()
configure:11490: gcc -o conftest.exe -g -O2   -L/usr/local/lib conftest.c  -lncurses >&5
conftest.c: In function 'main':
conftest.c:49:26: warning: implicit declaration of function 'tgetent' [-Wimplicit-function-declaration]
char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");
^~~~~~~

我也一直在想,如果只是产生了相同的错误消息(需要一个终端库),因为tgetent的声明(或定义)似乎有问题。

最后仍然是相同的错误消息

configure:11494: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.

有人在cygwin中处理windows时,在使用工具链的自定义安装时遇到过同样的问题吗?

提前谢谢。如果您需要更多信息,请随时询问。


编辑(2017年7月11日,11:35-CH)

这是我的第一个错误,它只是在配置过程中重复了几次:

configure:3503: gcc -E  conftest.c
conftest.c:10:28: fatal error: ac_nonexistent.h: No such file or directory
#include <ac_nonexistent.h>
^
compilation terminated.
configure:3503: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define UNIX 1
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3528: result: gcc -E

编辑(2017年7月11日,13:42-CH)

有了babun,我终于可以运行configurevim了。但在运行make时,我遇到了另一个错误:

Starting make in the src directory.
If there are problems, cd to the src directory and run make there
cd src && D:/developtools/mingw32/bin/mingw32-make first
mingw32-make[1]: Entering directory 'D:/developtools/.babun/cygwin/home/tobbe/vim/src'
gcc -c -I.   -I/usr/include/python2.7 -DPYTHON_HOME='"/usr"' -pthread -fPIE    -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1        -o objects/option.o option.c
gcc: fatal error: no input files
compilation terminated.
Makefile:3215: recipe for target 'objects/option.o' failed
mingw32-make[1]: *** [objects/option.o] Error 1

我已经查看了objects目录,实际上选项.o并没有创建。

我最近遇到了同样的问题。在cygwin上,vim的./configure失败,并显示以下消息。

checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
On Linux that would be the libncurses-dev package.
Or specify the name of the library with --with-tlib.

但是libncurses-dev已经安装。

在四处搜索后,按照此处的建议检查src/auto/config.log

configure:11931: checking for tgetent in -lcurses
configure:11956: gcc -o conftest.exe -g -O2   -L/usr/local/lib conftest.c -lcurses   -lselinux >&5
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lselinux: No such file or directory
collect2: error: ld returned 1 exit status

则转到CCD_ 7&amp;/usr/local/lib

ls -l /usr/lib /usr/local/lib
/usr/lib:
total 109995
... libncurses.a libncurses.dll.a ...
/usr/local/lib:
total 0
python3.8

现在找到了原因,libncurses/usr/lib,但不知何故,./configure使用了/usr/local/lib,让我们添加链接标志。在这种情况下,在用LDFLAGS="-L/usr/lib"预处理./configure之后,它成功地构建了。以下是src/auto/config.log的新输出

configure:11931: checking for tgetent in -lncursesw
configure:11956: gcc -o conftest.exe -g -O2  -L/usr/lib -L/usr/local/lib conftest.c -lncursesw    >&5
configure:11956: $? = 0
configure:11966: result: yes

此外,在cygwin上,要构建vim,请确保至少安装以下软件包。

make automake libncurses-devel gcc-g++ cscope python3-devel

更多信息:

automake automatically add autoconf
gcc-g++ automatically add gcc-core
libncurses-devel automatically add pkg-config libncursesw10 libncurses++w10

相关内容

最新更新