为什么在构建gdb时找不到termcap库?


10

make 然后失败:

配置:错误:没有找到termcap库,但是那个termcap库就在那里,为什么找不到它?

checking for library containing zlibVersion... -lz
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing dlgetmodinfo... no
checking for iconv... yes
checking for iconv declaration... install-shextern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for library containing waddstr... no
configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
configure: error: no termcap library found
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/var/lib/gforge/chroot/home/users/mirror/tmp/gdb-7.5'
make: *** [all] Error 2

我用以下命令配置gdb:

[mirror@hugemeow gdb-7.5]$ ./configure --libdir=/var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/lib/


checking where to find the target readelf... host tool
checking where to find the target strip... host tool
checking where to find the target windres... host tool
checking where to find the target windmc... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether -fkeep-inline-functions is supported... yes
configure: creating ./config.status
config.status: creating Makefile

我配置为gdb时,那个tempcap库就在那里

[mirror@hugemeow gdb-7.5]$ ls /var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/lib/
libtermcap.a
[mirror@hugemeow gdb-7.5]$ ls /var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/include/
termcap.h

编辑1:即使--includedir和--libdir选项也失败了...

[mirror@hugemeow gdb-7.5]$ ./configure --includedir=/var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/include/  --libdir=/var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/lib/
make
    checking for library containing tgetent... no
configure: error: no termcap library found
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/var/lib/gforge/chroot/home/users/mirror/tmp/gdb-7.5'
make: *** [all] Error 2

编辑2:现在,我按照Patrice Tisserand的指示进行构建,但也失败了,并显示以下不同的错误消息。

[mirror @ hugemeow gdb-7.5] $ CFLAGS =“-I / var / lib / gforge / chroot / home / users / mirror / ins / ins-gdb / include /” LDFLAGS =“-L / var / lib / gforge / chroot / home / users / mirror / ins / ins-gdb / lib /“ ./configure && make

make[1]: Entering directory `/var/lib/gforge/chroot/home/users/mirror/tmp/gdb-7.5'
Configuring in ./intl
configure: loading cache ./config.cache
configure: error: `CFLAGS' has changed since the previous run:
configure:   former value:  `-g -O2'
configure:   current value: `-I/var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/include/'
configure: error: `LDFLAGS' has changed since the previous run:
configure:   former value:  ` '
configure:   current value: ` -L/var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/lib/'
configure: error: in `/var/lib/gforge/chroot/home/users/mirror/tmp/gdb-7.5/intl':
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and start over
make[1]: *** [configure-intl] Error 1
make[1]: Leaving directory `/var/lib/gforge/chroot/home/users/mirror/tmp/gdb-7.5'
make: *** [all] Error 2

Answers:


18

安装libncurses将解决您的问题。试试这个,如果你使用任何Debian的操作系统: sudo apt-get install libncurses5-dev


2
我之所以如此,是因为我没有注意到我安装的是简单的libncurses而不是开发包。
纳撒尼尔(Nathaniel Waisbrot)2013年

这应该是公认的答案。顺便说一下,在OpenSUSE上它是ncurses-devel软件包。
Anh Tuan 2015年

3
./configure --includedir=/var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/include/  --libdir=/var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/lib/

--includedir--libdir安装目录的选项。

为了使用其他目录中的库,您可以尝试执行以下操作:

CFLAGS="-I/var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/include/" LDFLAGS="-L/var/lib/gforge/chroot/home/users/mirror/ins/ins-gdb/lib/" ./configure 

现在,我按照您的说明进行构建,但是也失败了,并显示以下不同的错误消息。看到编辑2
hugemeow 2012年

您好,您是否尝试按照消息输出中的建议进行distclean?
Patrice Tisserand

1

这非常有帮助:http : //archive09.linux.com/feature/121735

此示例显示了当找不到目标本机termcap库时如何成功(此处的交叉构建有些不同-如有疑问,请使用./configure --help):

cd ~/work/cross/gdb/downloads
wget ftp://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz
cd ..
tar xvzf downloads/termcap-1.3.1.tar.gz
mkdir -p ~/work/cross/gdb/build/termcap
cd ~/work/cross/gdb/build/termcap

export CC=powerpc-7450-linux-gnu-gcc
export RANLIB=powerpc-7450-linux-gnu-ranlib
../../termcap-1.3.1/configure --host=powerpc-7450-linux-gnu --prefix=$HOME/work/cross/termcap
make
make install

您确实不想覆盖这样的目标,它将在运行时开始不存在该路径的远程目标上寻找该路径。 make DESTDIR=$HOME/work/cross install解决该问题,但无助于查找构建依赖项
Ben Voigt 2015年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.