[libvirt] libvirt usage

Hi I have a Ubutnu system . I installed libxml2 and libvirt packages by : apt-get install ibvirt-bin and .. libxml2 . They were installed ok . The libraries are located under /user/lib e.g : /usr/lib/libvirt.so.0 I am trying to link as follows: CFLAGS=`pkg-config --cflags libvirt` LDFLAGS=`pkg-config --libs libvirt` gcc -o test_cpu $CFLAGS $LDFLAGS test_cpu.c But get the message : Package libvirt was not found in the pkg-config search path. Perhaps you should add the directory containing `libvirt.pc' to the PKG_CONFIG_PATH environment variable No package 'libvirt' found It turns out that doing : pkg-config --list-all | grep libvirt return no libvirt traces . just as in the file below . On another older machine that links fine - libvirt is found with the above pkg-config but there is no PKG_CONFIG_PATH env variable as well . Both machines PATH is the same . Did I miss something during the install of the first machine. Any remedy ? Zvi Dubitzky Virtualization and System Architecture Email:dubi@il.ibm.com IBM Haifa Research Laboratory Phone: +972-4-8296182 Haifa, 31905, ISRAEL

On Thu, Mar 12, 2009 at 07:06:44PM +0200, Zvi Dubitzky wrote:
Did I miss something during the install of the first machine. Any remedy ?
If you're doing development with a library foo it's usually a good idea to install the foo-devel package ! Not specific to libvirt or libxml2 ... Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Thu, Mar 12, 2009 at 07:06:44PM +0200, Zvi Dubitzky wrote:
Hi
I have a Ubutnu system . I installed libxml2 and libvirt packages by : apt-get install ibvirt-bin and .. libxml2 . They were installed ok . The libraries are located under /user/lib e.g : /usr/lib/libvirt.so.0
I am trying to link as follows: CFLAGS=`pkg-config --cflags libvirt` LDFLAGS=`pkg-config --libs libvirt` gcc -o test_cpu $CFLAGS $LDFLAGS test_cpu.c
But get the message :
Package libvirt was not found in the pkg-config search path. Perhaps you should add the directory containing `libvirt.pc' to the PKG_CONFIG_PATH environment variable No package 'libvirt' found
It turns out that doing : pkg-config --list-all | grep libvirt
return no libvirt traces .
As Daniel mentions, this suggests that you have not installed the development package for libvirt. On Ubuntu, I believe this will be called "libvirt-dev" Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Zvi Dubitzky