windows下boost库的配置
来源:互联网 发布:微信排队返利源码 编辑:程序博客网 时间:2024/05/16 23:53
1)到官网下载boost库
http://www.boost.org/
2)解压,双击bootstrap.bat,生成bjam.exe,双击bjam.exe,约十分钟编译完成
3)打开vs,项目属性,vc目录,包含目录include directories(G:\boost_1_64_0)
库目录library directories(G:\boost_1_64_0\stage\lib)
c/c++,常规,额外包含目录(G:\boost_1_64_0\stage\lib)
#include <boost\shared_ptr.hpp>#include <iostream>class Simple{public:Simple(int param = 0){m_number = param;std::cout << "Simple: " << m_number << std::endl;}~Simple(){std::cout << "~Simple: " << m_number << std::endl;}void Print(){std::cout << "Print: " << m_info.c_str() << std::endl;}std::string m_info;private:int m_number;};void Test(boost::shared_ptr<Simple> simple){simple->Print();std::cout << "In Test(),UseCount:" << simple.use_count() << std::endl;}int main(){boost::shared_ptr<Simple> mySimple(new Simple(1));if (mySimple.get())////访问裸指针。由于智能指针是一个对象,所以if(smart_object)永远为真。{mySimple->Print();mySimple.get()->m_info = "Hello";mySimple->Print();(*mySimple).m_info += "World";mySimple->Print();}std::cout << "1. useCount" << mySimple.use_count() << std::endl;Test(mySimple);std::cout << "2. useCount" << mySimple.use_count() << std::endl;system("pause");}
阅读全文
0 0
- BOOST库在Windows下的配置
- BOOST库在windows下的配置
- windows下boost库的配置
- windows下配置boost库
- BOOST库在Windows下的配置 [转]
- windows下的boost库
- windows下编译、配置Boost库
- windows下vs 2015下libtorrent库的配置,vs2015下-boost-openssl-libtorrent的配置
- Windows 下配置Boost MPI
- windows 下boost库的简单编译
- Boost库的Windows下安装
- windows下!boost库的编译选项
- windows下boost库的基本使用方法
- windows下boost库的基本使用方法
- windows下boost库的基本使用方法
- Windows下使用Boost库的安装
- windows下boost库的选择
- windows下boost,pthread,clapack,jpeg,gsl的配置
- 简单的简历模板
- ssh host key verification failed
- hihoCoder #1041 : 国庆出游 ( 深搜,树的遍历 )
- android init 进程详解(基于AOSP master分支)
- 关于初次接触电离层的一些问题
- windows下boost库的配置
- COGS-796 dispatching(左偏树)
- HTTP专题--(2)TCP连接
- http协议详解
- Log4j输出格式控制---PatternLayout参数含义
- 【UOJ #210】【UER #6】寻找罪犯 (2-sat 详解)
- 原生js实现获取form表单数据
- regraphic
- Java中Synchronized的用法