Efstratios Skleparis
2015-Oct-15 20:57 UTC
[Libguestfs] Build libguestfs error with undefined reference to `guestfs_int_init_libvirt_backend'
Dear all, I am trying to build libguestfs library on my system : Ubuntu Server 12.04 x64bit on XEN hypervisor. I have followed all instructions on their homepage but whey i am trying to build the library make -> gives me the following error: libguestfs.so: undefined reference to `guestfs_int_init_libvirt_backend' Here is a sample code of the error : make[2]: Entering directory `/home/str/libguestfs-1.30.3/examples' CCLD create-disk ../src/.libs/libguestfs.so: undefined reference to `guestfs_int_init_libvirt_backend' collect2: ld returned 1 exit status make[2]: *** [create-disk] Error 1 make[2]: Leaving directory `/home/str/libguestfs-1.30.3/examples' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/str/libguestfs-1.30.3' make: *** [all] Error 2 I have already installed all the dependencies for the library [sudo apt-get build-dep libguestfs] and updated my automake version to 1.13[latest for ubuntu 12.04] as i have read on another redhat list post [this one : https://www.redhat.com/archives/libguestfs/2014-January/msg00015.html ] but still nothing.. I must be missing something ! I haven't done anything rather than ./configure && make Any tips/help would be appreciated. Stratos
Richard W.M. Jones
2015-Oct-15 21:26 UTC
Re: [Libguestfs] Build libguestfs error with undefined reference to `guestfs_int_init_libvirt_backend'
On Thu, Oct 15, 2015 at 11:57:49PM +0300, Efstratios Skleparis wrote:> Dear all, > > I am trying to build libguestfs library on my system : Ubuntu Server 12.04 > x64bit on XEN hypervisor. > > I have followed all instructions on their homepage but whey i am trying to > build the library make -> gives me the following error: libguestfs.so: > undefined reference to `guestfs_int_init_libvirt_backend' > > Here is a sample code of the error : > > make[2]: Entering directory `/home/str/libguestfs-1.30.3/examples' > CCLD create-disk > ../src/.libs/libguestfs.so: undefined reference to > `guestfs_int_init_libvirt_backend' > collect2: ld returned 1 exit status > make[2]: *** [create-disk] Error 1 > make[2]: Leaving directory `/home/str/libguestfs-1.30.3/examples' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/home/str/libguestfs-1.30.3' > make: *** [all] Error 2 > > I have already installed all the dependencies for the library [sudo apt-get > build-dep libguestfs] and updated my automake version to 1.13[latest for > ubuntu 12.04] as i have read on another redhat list post [this one : > https://www.redhat.com/archives/libguestfs/2014-January/msg00015.html ] but > still nothing.. I must be missing something ! > > I haven't done anything rather than ./configure && makeYup, this is actually a bug in the library. I'm guessing you have libvirt-dev installed, but it is some ancient version (less than 0.10.2 specifically). This means libvirt is compiled out of the library here: https://github.com/libguestfs/libguestfs/blob/677c721e85380fc54ae6d0bebe885101360a6028/src/launch-libvirt.c#L64-L80 but still referenced here: https://github.com/libguestfs/libguestfs/blob/677c721e85380fc54ae6d0bebe885101360a6028/src/launch.c#L518-L520 You can just comment out lines 518-520 in the latter file to make it work. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Richard W.M. Jones
2015-Oct-15 21:40 UTC
Re: [Libguestfs] Build libguestfs error with undefined reference to `guestfs_int_init_libvirt_backend'
The attached patch may be a full fix. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Richard W.M. Jones
2015-Oct-16 07:50 UTC
Re: [Libguestfs] Build libguestfs error with undefined reference to `guestfs_int_init_libvirt_backend'
[Please keep all replies on the list.] On Fri, Oct 16, 2015 at 03:01:42AM +0300, Efstratios Skleparis wrote:> Dear Richard, > > Yes I do have libvirt-dev installed already and virsh --version was : 0.9.8 > ! > > - I tried to comment out the lines but still i got some errors due to that > [ undeclared variables etc. ] > > - Made changes to files : > > src/guestfs-internal.h > > src/launch-libvirt.c > > src/launch.c > > As you mentioned on the patch but still had errors on building the > library.. > > Didn't save the error output because the solution was just to update > libvirt , 0.9.8 version to a latter one has that bug as it seemed.. > > I chose to update from 0.9.8 to 1.2.20 from tarball and finally I could > build the library -> ./configure && make worked like charm [took like 6-8 > mins though : P] !! > > Thanks again for your time and your fast response !-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Reasonably Related Threads
- Build libguestfs error with undefined reference to `guestfs_int_init_libvirt_backend'
- Re: [Error] guestfsd: /usr/lib/libaugeas.so.0: version `AUGEAS_0.16.0' not found (required by guestfsd)
- Re: [Error] guestfsd: /usr/lib/libaugeas.so.0: version `AUGEAS_0.16.0' not found (required by guestfsd)
- Re: Build libguestfs error with undefined reference to `guestfs_int_init_libvirt_backend'
- [Error] guestfsd: /usr/lib/libaugeas.so.0: version `AUGEAS_0.16.0' not found (required by guestfsd)