Re: [Libguestfs] Build libguestfs error with undefined reference to `tgetnum'

Richard W.M. Jones
2014-01-05T14:48:12Z

On Sun, Jan 05, 2014 at 02:11:21PM +0700, Nguyễn Trường Sơn
wrote:
> Hi
>
> I want to build libguestfs on my laptop.
> I run Centos 6.4, libguestfs libguestfs-1.24.3.
>
> I get this error:
>
> Wide character in print at /root/libguestfs-1.24.3/podwrapper.pl line 418.
> podwrapper.pl: wrote guestfish.1
> podwrapper.pl: wrote ../html/guestfish.1.html
> touch stamp-guestfish.pod
>   CCLD     guestfish
> guestfish-progress.o: In function `progress_bar_set':
> /root/libguestfs-1.24.3/fish/progress.c:282: undefined reference to
> `tgetnum'
> guestfish-progress.o: In function `fprintf':
> /usr/include/bits/stdio2.h:98: undefined reference to `UP'
> guestfish-progress.o: In function `progress_bar_init':
> /root/libguestfs-1.24.3/fish/progress.c:123: undefined reference to
> `tgetent'
> collect2: ld returned 1 exit status
> make[3]: *** [guestfish] Error 1
> make[3]: Leaving directory `/root/libguestfs-1.24.3/fish'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/root/libguestfs-1.24.3/fish'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/root/libguestfs-1.24.3'
> make: *** [all] Error 2
>
>
> I've read this page
> http://www.redhat.com/archives/libguestfs/2012-September/msg00025.html
>
> I have libtinfo on my machine:
>
> /lib64/libtinfo.so.5
> /lib64/libtinfo.so.5.7
> /usr/lib/libtinfo.so
>
> Check the tgetnum, UP, tgetent
>
> nm -D /usr/lib64/libtinfo.so | grep tgetnum
> 0000003cd1210c40 T tgetnum
>
> nm -D /usr/lib64/libtinfo.so | grep UP
> 0000003cd1420fa8 B UP
>
> nm -D /usr/lib64/libtinfo.so | grep tgetent
> 0000003cd1210f00 T tgetent

I think the problem is you have to re-run ./configure after installing
the library, since otherwise it doesn't know to link with the right
library.

If you're using ./configure -C (ie. caching enabled) you will also
need to delete config.cache before re-running ./configure.

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.