<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[张宴的博客]]></title> 
<link>http://zyan.cc/index.php</link> 
<description><![CDATA[Web系统架构与底层研发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[张宴的博客]]></copyright>
<item>
<link>http://zyan.cc/libevent_windows/</link>
<title><![CDATA[Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>张宴 &lt;net@s135.com&gt;</author>
<category><![CDATA[Windows相关]]></category>
<pubDate>Wed, 30 Mar 2011 00:40:22 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/</guid> 
<description>
<![CDATA[ 
	　　[文章作者：张宴 本文版本：v1.0 最后修改：2011.03.30 转载请注明原文链接：<a href="http://blog.zyan.cc/libevent_windows/" target="_blank">http://blog.zyan.cc/libevent_windows/</a>]<br/><br/>　　本文介绍了如何在 Windows 操作系统中，利用微软 Visual Studio 2005 编译生成 <a href="http://monkey.org/~provos/libevent/" target="_blank">Libevent</a> 2.0.10 静态链接库，并利用 <a href="http://monkey.org/~provos/libevent/" target="_blank">Libevent</a> 静态链接库，实现一个简单的 HTTP Web服务器程序：httpd.exe。<br/><br/>　　假设 Visual Studio 2005 的安装路径为“D:&#92;Program Files&#92;Microsoft Visual Studio 8&#92;”，<a href="http://monkey.org/~provos/libevent/" target="_blank">Libevent</a> 2.0.10 解压后的路径为“D:&#92;libevent-2.0.10-stable”。<br/><br/><hr/><br/>　　<strong>一、编译生成 Libevent 2.0.10 静态链接库。</strong><br/>　　<br/>　　1、修改“D:&#92;libevent-2.0.10-stable&#92;event_iocp.c”、“D:&#92;libevent-2.0.10-stable&#92;evthread_win32.c”、“D:&#92;libevent-2.0.10-stable&#92;listener.c”三个文件，在文件开头分别加上一行：<br/><div style="border-left: 0px dashed #D6C094; margin: 5px; padding: 3px; margin-bottom:0px; border: 1px dashed #00a0c6; background-color: #ffffff;">#define _WIN32_WINNT 0x0500</div><br/><br/>　　2、鼠标点击Windows左下角的【开始】-【所有程序】，找到【Microsoft Visual Studio 2005】，执行下图中的脚本：<br/><br/>　　<a href="http://zyan.cc/attachment/201103/libevent/libevent1.png" target="_blank"><img src="http://zyan.cc/attachment/201103/libevent/libevent1.png" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/><br/>　　3、按照下图中的方法编译Libevent 2.0.10：<br/><br/>　　<a href="http://zyan.cc/attachment/201103/libevent/libevent2.png" target="_blank"><img src="http://zyan.cc/attachment/201103/libevent/libevent2.png" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/><br/>　　4、生成的“libevent.lib”、“libevent_core.lib”、“libevent_extras.lib”三个文件就是我们需要的 Libevent 静态链接库。<br/><br/>　　<a href="http://zyan.cc/attachment/201103/libevent/libevent3.png" target="_blank"><img src="http://zyan.cc/attachment/201103/libevent/libevent3.png" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/><hr/><br/>　　<strong>二、利用 Libevent 静态链接库，实现一个简单的 HTTP Web服务器程序</strong><br/><br/>　　1、打开 Visual Studio 2005，新建一个项目<br/><br/>　　<a href="http://zyan.cc/attachment/201103/libevent/libevent4.png" target="_blank"><img src="http://zyan.cc/attachment/201103/libevent/libevent4.png" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>............<br/><br/>Tags - <a href="http://zyan.cc/tags/libevent/" rel="tag">libevent</a> , <a href="http://zyan.cc/tags/windows/" rel="tag">windows</a> , <a href="http://zyan.cc/tags/vs2005/" rel="tag">vs2005</a> , <a href="http://zyan.cc/tags/visual/" rel="tag">visual</a> , <a href="http://zyan.cc/tags/studio/" rel="tag">studio</a> , <a href="http://zyan.cc/tags/lib/" rel="tag">lib</a> , <a href="http://zyan.cc/tags/%25E9%259D%2599%25E6%2580%2581%25E9%2593%25BE%25E6%258E%25A5%25E5%25BA%2593/" rel="tag">静态链接库</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8032</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>kernel &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 30 Mar 2011 01:32:46 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8032</guid> 
<description>
<![CDATA[ 
	沙发
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8033</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>Wendal &lt;wendal1985@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 30 Mar 2011 01:33:53 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8033</guid> 
<description>
<![CDATA[ 
	还真不是一般的复杂<br/><br/>不过,借问一句,这种Http服务器,能干些什么吗? 单单是为了演示libevent的使用?
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8035</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>ccne &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 30 Mar 2011 03:03:56 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8035</guid> 
<description>
<![CDATA[ 
	用PYTHON不是更简单？
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8047</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>niniwzw &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 31 Mar 2011 03:45:42 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8047</guid> 
<description>
<![CDATA[ 
	张老师问你几个问题：ws2_32.lib wsock32.lib 这两个库有什么差别。我用了 ws2_32.lib&nbsp;&nbsp;这一个库，就能链接成功。<br/>还有，为什么要忽略 libc.lib;msvcrt.lib;libcd.lib;libcmtd.lib;msvcrtd.lib 这些库呢？是什么原因。
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8049</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>niniwzw &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 31 Mar 2011 03:55:13 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8049</guid> 
<description>
<![CDATA[ 
	张老师有空研究研究2.0的代码。写几篇博客，给我们参考参考。
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8051</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>liexusong &lt;liexusong@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 31 Mar 2011 06:08:27 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8051</guid> 
<description>
<![CDATA[ 
	libevent在win下是使用select的, 一点优势都没有~
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8056</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>泥水匠 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 01 Apr 2011 01:47:24 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8056</guid> 
<description>
<![CDATA[ 
	你好！<br/>请问如果不做网络应用，能否把ws2_32.lib wsock32.lib这两个依赖库去掉？
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8057</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>火麒麟 &lt;ynhuoqilin@163.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 01 Apr 2011 02:30:45 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8057</guid> 
<description>
<![CDATA[ 
	初来乍到，先不知道说点什么，就留下一个臭臭的脚丫
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8059</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>宁波LED &lt;hualala089@163.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 01 Apr 2011 03:03:40 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8059</guid> 
<description>
<![CDATA[ 
	好复杂哦，来支持一下博主把。
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8063</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>agile &lt;webmaster@freezingsun.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 01 Apr 2011 14:20:24 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8063</guid> 
<description>
<![CDATA[ 
	C很强大。
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8071</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>www.zhuna5.com住哪 &lt;ec29@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 03 Apr 2011 13:07:23 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8071</guid> 
<description>
<![CDATA[ 
	好好复杂啊
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8072</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>停牌 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Mon, 04 Apr 2011 04:20:59 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8072</guid> 
<description>
<![CDATA[ 
	恩~！学习啦~
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8080</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>coach outletwristlet &lt;www.cal@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 05 Apr 2011 08:30:34 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8080</guid> 
<description>
<![CDATA[ 
	太复杂了&nbsp;&nbsp;有简单一点的不？
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8085</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>美女艳图 &lt;254646@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 05 Apr 2011 13:22:06 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8085</guid> 
<description>
<![CDATA[ 
	学习一下，不断进步。
]]>
</description>
</item><item>
<link>http://zyan.cc/libevent_windows/#blogcomment8092</link>
<title><![CDATA[[评论] Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器]]></title> 
<author>coach factoryoutletsale &lt;www.cal@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 06 Apr 2011 10:43:20 +0000</pubDate> 
<guid>http://zyan.cc/libevent_windows/#blogcomment8092</guid> 
<description>
<![CDATA[ 
	向老师学习了！
]]>
</description>
</item>
</channel>
</rss>