<div class="gmail_quote"><br>I ran 'sudo make install' in /path/to/libvirt. But same error is coming.<br>Maybe following will be helpful:<br>-> I extracted the libvirt.<span style="background-color:rgb(255,255,0)" name="textmarker_18"></span>0.10.1 in ~/Downloads<br>


-> And I am running the code in ~/Downloads/libvirt-0.10.1<br>-> I ran 'sudo make install' in the above directory.<div class="HOEnZb"><div class="h5"><br><span style="background-color:rgb(255,255,0)" name="textmarker_52"></span><span style="background-color:rgb(255,255,0)" name="textmarker_51"></span><span style="background-color:rgb(255,255,0)" name="textmarker_50"></span><span style="background-color:rgb(255,255,0)" name="textmarker_49"></span><span style="background-color:rgb(255,255,0)" name="textmarker_48"></span><span style="background-color:rgb(255,255,0)" name="textmarker_47"></span><span style="background-color:rgb(255,255,0)" name="textmarker_46"></span><span style="background-color:rgb(255,255,0)" name="textmarker_45"></span><span style="background-color:rgb(255,255,0)" name="textmarker_44"></span><span style="background-color:rgb(255,255,0)" name="textmarker_43"></span><span style="background-color:rgb(255,255,0)" name="textmarker_42"></span><span style="background-color:rgb(255,255,0)" name="textmarker_41"></span><br>


<span style="background-color:rgb(255,255,0)" name="textmarker_39"></span><span style="background-color:rgb(255,255,0)" name="textmarker_38"></span><span style="background-color:rgb(255,255,0)" name="textmarker_37"></span><span style="background-color:rgb(255,255,0)" name="textmarker_36"></span><span style="background-color:rgb(255,255,0)" name="textmarker_35"></span><span style="background-color:rgb(255,255,0)" name="textmarker_34"></span><span style="background-color:rgb(255,255,0)" name="textmarker_33"></span><span style="background-color:rgb(255,255,0)" name="textmarker_32"></span><span style="background-color:rgb(255,255,0)" name="textmarker_31"></span><span style="background-color:rgb(255,255,0)" name="textmarker_30"></span><span style="background-color:rgb(255,255,0)" name="textmarker_29"></span><span style="background-color:rgb(255,255,0)" name="textmarker_28"></span><span style="background-color:rgb(255,255,0)" name="textmarker_27"></span><span style="background-color:rgb(255,255,0)" name="textmarker_26"></span><span style="background-color:rgb(255,255,0)" name="textmarker_25"></span><span style="background-color:rgb(255,255,0)" name="textmarker_24"></span><span style="background-color:rgb(255,255,0)" name="textmarker_23"></span><span style="background-color:rgb(255,255,0)" name="textmarker_22"></span><span style="background-color:rgb(255,255,0)" name="textmarker_21"></span><span style="background-color:rgb(255,255,0)" name="textmarker_20"></span><span style="background-color:rgb(255,255,0)" name="textmarker_19"></span><span style="background-color:rgb(255,255,0)" name="textmarker_17"></span><span style="background-color:rgb(255,255,0)" name="textmarker_16"></span><span style="background-color:rgb(255,255,0)" name="textmarker_15"></span><span style="background-color:rgb(255,255,0)" name="textmarker_14"></span><span style="background-color:rgb(255,255,0)" name="textmarker_13"></span><span style="background-color:rgb(255,255,0)" name="textmarker_11"></span><span style="background-color:rgb(255,255,0)" name="textmarker_10"></span><span style="background-color:rgb(255,255,0)" name="textmarker_9"></span><span style="background-color:rgb(255,255,0)" name="textmarker_8"></span><span style="background-color:rgb(255,255,0)" name="textmarker_7"></span><span style="background-color:rgb(255,255,0)" name="textmarker_6"></span><span style="background-color:rgb(255,255,0)" name="textmarker_5"></span><span style="background-color:rgb(255,255,0)" name="textmarker_4"></span><span style="background-color:rgb(255,255,0)" name="textmarker_3"></span><span style="background-color:rgb(255,255,0)" name="textmarker_2"></span><span style="background-color:rgb(255,255,0)" name="textmarker_1"></span><br>


<div class="gmail_quote">On 2 September 2012 16:24, Michal Privoznik <span dir="ltr"><<a href="mailto:mprivozn@redhat.com" target="_blank">mprivozn@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


On 02.09.2012 09:53, Rahul Bansal wrote:<br>
> /* example ex1.c */<br>
> /* compile with: gcc -g -Wall ex1.c -o ex -lvirt */<br>
> #include <stdio.h><br>
> #include <stdlib.h><br>
> #include "include/libvirt/libvirt.h"<br>
<br>
since you are including this path assume you use<br>
-I/path/to/libvirt/source and don't have libvirt installed in your<br>
system. Hence you need to provide linker the path where it will find the<br>
library:<br>
gcc -I/path/to/libvirt -L/path/to/libvirt/src -lvirt ex1.c -o ex1<br>
<br>
or just install libvirt ('sudo make install' in /path/to/libvirt) and<br>
then you can drop both -I and -L arguments.<br>
<br>
> int main(int argc, char *argv[])<br>
> {<br>
> virConnectPtr conn;<br>
> conn = virConnectOpen("qemu:///system");<br>
> if (conn == NULL) {<br>
> fprintf(stderr, "Failed to open connection to qemu:///system\n");<br>
> return 1;<br>
> }<br>
> virConnectClose(conn);<br>
> return 0;<br>
> }<br>
<br>
</blockquote></div><br>
</div></div></div><br>