<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
        FONT-SIZE: 10.5pt; COLOR: #000000; LINE-HEIGHT: 1.5; FONT-FAMILY: 宋体
}
</STYLE>

<META content="MSHTML 6.00.2900.6212" name=GENERATOR></HEAD>
<BODY style="MARGIN: 10px">
<DIV>Hi,ALL:</DIV>
<DIV>   I compiled the libvirt-0.9.11 source code with mingw on 
windows according to the website:</DIV>
<DIV>        <A 
href="https://github.com/photron/msys_setup">https://github.com/photron/msys_setup</A></DIV>
<DIV>   Then I wrote a simple test case ,as 
below:</DIV>
<DIV>   </DIV>
<DIV style="FONT-STYLE: italic">#include <stdio.h></DIV>
<DIV style="FONT-STYLE: italic">#include <stdlib.h></DIV>
<DIV style="FONT-STYLE: italic">#include "libvirt/libvirt.h"</DIV>
<DIV style="FONT-STYLE: italic"> </DIV>
<DIV 
style="FONT-STYLE: italic">int main(int argc,char **argv)</DIV>
<DIV style="FONT-STYLE: italic">{</DIV>
<DIV style="FONT-STYLE: italic">  virConnectPtr conn;</DIV>
<DIV style="FONT-STYLE: italic"></DIV>
<DIV style="FONT-STYLE: italic">  
conn = virConnectOpen("qemu+tcp://192.168.1.6/system");</DIV>
<DIV style="FONT-STYLE: italic">  if (conn = NULL)</DIV>
<DIV style="FONT-STYLE: italic">  { </DIV>
<DIV style="FONT-STYLE: italic">    
fprintf(stderr,"Failed to open connection to qemu+tcp://192.168.1.6/system");</DIV>
<DIV style="FONT-STYLE: italic">    return 1;</DIV>
<DIV style="FONT-STYLE: italic">  }</DIV>
<DIV style="FONT-STYLE: italic">  virConnectClose(conn);</DIV>
<DIV style="FONT-STYLE: italic">  return 0;</DIV>
<DIV style="FONT-STYLE: italic">}</DIV>
<DIV> </DIV>
<DIV> When linked to the dll just compiled , it came out with error :</DIV>
<DIV> </DIV>
<DIV>
<DIV 
style="FONT-STYLE: italic">NOTE: you should run 'diskperf -y' to enable the disk statistics</DIV>
<DIV 
style="FONT-STYLE: italic">libvir: RPC error : Unable to set close-on-exec flag: No such file or directory</DIV>
<DIV 
style="FONT-STYLE: italic">libvir: error : invalid connection pointer in virConnectClose</DIV></DIV>
<DIV> </DIV>
<DIV> When using gdb to debug the testcase , break the function 
virConnectOpen , then step ,the error info was:</DIV>
<DIV>Program received signal ?,Unknown signal.</DIV>
<DIV>0x7c92e4ff in ntdll!LdrAlternateResourcesEnabled ()</DIV>
<DIV>from C:\WINDOWS.0\system32\ntdll.dll</DIV>
<DIV> </DIV>
<DIV>Any suggestion would be appreciated !</DIV>
<DIV> </DIV>
<DIV>Best Regards!</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>

<DIV><SPAN>xuteng<SPAN 
style="FONT-SIZE: 10.5pt; COLOR: #969696; FONT-STYLE: italic; FONT-FAMILY: Microsoft Sans Serif"> 
via foxmail</SPAN></SPAN></DIV></BODY></HTML>