C Programming libvirt Configuration

Source: Internet
Author: User

If you really use libvirt C language dynamic link library for programming, you need to install the libvirt Installation File
Download libvirt9.9.0-tar.gz and decompress the file tar zxvf.
Libvirt-0.9.0.tar.gz. After decompression is complete, go to the folder
Libvirt-0.9.0 start Installation

1../configure
2. If libxml2 is missing, install libxml2.sudo apt-Get install libxml2.
Libxml2-dev

Attachment: ftp://xmlsoft.org/libxml2/ if manually installed
3. Re-./configure. A message indicating that the guntls cannot be found is displayed.
4. Install the guntls library. Sudo apt-Get install gnutls-Doc gnutls-bin, sudo
Apt-Get install libneon27-gnutls libcurl4-gnutls-dev.
5. Then./configure, and the system prompts that the device-mapper-devel is missing,
6. Download The device-mapper.1.02.28.tgz from the Internet and decompress tar zxvf
Device-mapper.1.02.28.tgz,
Go to the decompressed Folder: CD device-mapper.1.02.28. Install device-mapper.
(1)./configure
(2) sudo
Make
(3) sudo
Make install
Then exit the folder and reinstall libvirt.
7. Entering the libvirt-0.9.0,./configure, no error
8. sudo make
9. sudo make install
Libvirt has been installed. However, if you want to use virsh, you need to use the absolute path of virsh.
(If virsh is run at this time, an error occurs. According to the prompt, we think it is caused by libvirt dependency. In order to use virsh Shell
Script,
We can use the original absolute path of virsh to find this executable file. For example, usr/bin/virsh)

Use of C language library
After editing the. cpp Source Code (for example, myxm. cpp), compile g ++ myxm. cpp-lvirt-O myxm in the command line.
Then run./myxm.

 

 

Libgcrypt: http://mirrors.dotsrc.org/gcrypt/libgcrypt/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.