﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-技术博客-随笔分类-boost</title><link>http://www.cppblog.com/chenjunjun/category/20971.html</link><description>c/c++/python/linux</description><language>zh-cn</language><lastBuildDate>Wed, 17 Sep 2014 10:43:25 GMT</lastBuildDate><pubDate>Wed, 17 Sep 2014 10:43:25 GMT</pubDate><ttl>60</ttl><item><title>vs 2013 配置 asio 开发环境</title><link>http://www.cppblog.com/chenjunjun/archive/2014/09/17/208346.html</link><dc:creator>chenjunjun</dc:creator><author>chenjunjun</author><pubDate>Wed, 17 Sep 2014 10:22:00 GMT</pubDate><guid>http://www.cppblog.com/chenjunjun/archive/2014/09/17/208346.html</guid><wfw:comment>http://www.cppblog.com/chenjunjun/comments/208346.html</wfw:comment><comments>http://www.cppblog.com/chenjunjun/archive/2014/09/17/208346.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/chenjunjun/comments/commentRss/208346.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/chenjunjun/services/trackbacks/208346.html</trackback:ping><description><![CDATA[<div>### 我的环境<br /><br />&nbsp;&nbsp; &nbsp;操作系统：windows 7 x64 sp1<br />&nbsp;&nbsp; &nbsp;VS版本：VS 2013<br />&nbsp;&nbsp; &nbsp;Boost版本：1.56.0<br /><br />### 下载boost<br /><br />&nbsp;&nbsp; &nbsp;官网：www.boost.org<br /><br />&nbsp;&nbsp; &nbsp;下载预编译版本的boost：http://sourceforge.net/projects/boost/files/boost-binaries/<br />&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;我下载的版本：<br />&nbsp;&nbsp; &nbsp;http://sourceforge.net/projects/boost/files/boost-binaries/1.56.0/boost_1_56_0-msvc-12.0-32.exe/download<br />&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;<br />### 安装<br /><br />&nbsp;&nbsp; &nbsp;直接运行下载exe文件，可以选择安装路径。<br />&nbsp;&nbsp; &nbsp;我的安装目录为：E:\lib\boost_1_56_0<br />&nbsp;&nbsp; &nbsp;<br />### 创建测试项目<br /><br />&nbsp;&nbsp; &nbsp;我创建的项目为：boost_asio_test<br /><br />### 配置项目<br /><br />#### 配置 boost asio 头文件<br /><br />&nbsp;&nbsp; &nbsp;右键项目属性，弹出配置窗口；<br />&nbsp;&nbsp; &nbsp;点击在配置属性-&gt;C/C++-&gt;常规-&gt;附加包含目录,出现下拉菜单，点击编辑，弹出窗口；<br />&nbsp;&nbsp; &nbsp;点击右右上角新建一条记录，内容为boost的安装路径：E:\lib\boost_1_56_0<br /><br />#### 配置 boost asio 库目录<br /><br />&nbsp;&nbsp; &nbsp;右键项目属性，弹出配置窗口；<br />&nbsp;&nbsp; &nbsp;点击在配置属性-&gt;连接器-&gt;常规-&gt;附加库目录, 出现下拉菜单，点击编辑，弹出窗口；<br />&nbsp;&nbsp; &nbsp;点击右右上角新建一条记录，内容为boost的安装路径中的库路径：E:\lib\boost_1_56_0\lib32-msvc-12.0<br /><br />#### 配置 boost asio 库文件<br /><br />&nbsp;&nbsp; &nbsp;库 date_time和 system 是 boost asio 的必须库。<br />&nbsp;&nbsp; &nbsp;右键项目属性，弹出配置窗口；<br />&nbsp;&nbsp; &nbsp;点击配置属性-&gt;连接器-&gt;输入-&gt;附加依赖项,出现下拉菜单，点击编辑，弹出窗口；<br />&nbsp;&nbsp; &nbsp;在上方的窗口中填写入:boost_date_time-vc120-mt-1_56.lib, boost_system-vc120-mt-1_56.lib 每行一条，这里为两行<br />&nbsp;&nbsp; &nbsp;<br />### 测试<br /><br />#include "stdafx.h"<br /><br />#include "boost/asio.hpp"<br /><br />using namespace boost::asio;<br /><br /><br />int _tmain(int argc, _TCHAR* argv[])<br />{<br />&nbsp;&nbsp; &nbsp;io_service io;<br />&nbsp;&nbsp; &nbsp;return 0;<br />}<br /><br />运行报错：<br />丢失 boost_system-vc120-mt-1_56.dll需要配置运行时的库：<br /><br />从boost库目录E:\lib\boost_1_56_0\lib32-msvc-12.0中复制：boost_date_time-vc120-mt-1_56.dll和boost_system-vc120-mt-1_56.dll到生成的exe文件目录下。<br />我的exe文件目录为:项目目录/Debug<br /><br />再次运行OK！</div><img src ="http://www.cppblog.com/chenjunjun/aggbug/208346.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/chenjunjun/" target="_blank">chenjunjun</a> 2014-09-17 18:22 <a href="http://www.cppblog.com/chenjunjun/archive/2014/09/17/208346.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>