centos使用boost过程
1. 安装gcc,g++,make等开发环境
yum groupinstall "Development Tools"
2. 安装boost
yum install boost boost-devel boost-doc
注意:默认的安装路径在/usr/lib64目录下
#include <boost/thread.hpp>
#include <iostream> void task1() {
// do stuff
std::cout << "This is task1!" << std::endl;
} void task2() {
// do stuff
std::cout << "This is task2!" << std::endl;
} int main (int argc, char ** argv) {
using namespace boost;
thread thread_1 = thread(task1);
thread thread_2 = thread(task2); // do other stuff
thread_2.join();
thread_1.join();
return 0;
}
4. makefile
g++ -I./inlcude -L./usr/lib64 test.cpp -lboost_thread-mt -o example
注意:默认的安装路径在/usr/lib64目录下
5.结果
./example
This is task2!
This is task1!
centos使用boost过程的更多相关文章
- Centos 安装boost库
1.在http://www.boost.org/下载boost安装包boost_1_65_1.tar.gz 2.在Centos上解压tar -zxvf boost_1_65_1.tar.gz后,cd ...
- centos安装cowboy过程
在centos机器上安装erlang: yum install erlang -y 接着把之前在ubuntu上的cowboy工程拷贝到centos机器上,进入到工程目录,输入: make run 提示 ...
- U盘在电脑上安装CentOS 7 系统过程详解
U盘制作CentOS系统启动盘 在电脑上下载并安装UltraISO软件,如百度云:http://pan.baidu.com/s/1hrGtvEG 打开UltraISO软件,找到CentOS.iso的映 ...
- CentOS 7安装过程
下载: https://wiki.centos.org/Download 安装过程: 参考: http://tieba.baidu.com/p/3152957061(图片出处)
- centos安装tmux过程
原文:https://gist.github.com/rothgar/cecfbd74597cc35a6018 # Install tmux on Centos release 6.5 # insta ...
- centos 虚拟机安装过程
centos装过好几次了,也装过好几次fedora,感觉centos更灵活些,这次我装了最简洁的centos,然后通过yum命令安装了各种需要的命令和软件,编译了phpredis.redis.和php ...
- python easy_install centos 下安装过程和原理解析
一.easy_install 安装过程 其安装过程有很多种,我也找了很多的例子,但是结果都不太好,以下方法的结果是不错的. easy_install与yum类似,使用easy_install,可以轻松 ...
- CentOS 7 安装过程中设置网络
如果在安装过程中需要使用网络,需要启动网卡,默认是DHCP 点击configure进入设置 General 常规设置 Automatically connect to this network whe ...
- 解决CentOS下boost安装后不能使用的问题
先说一说整个经历. 因为之前没有注意到gcc4.8.5比较旧,就已经安装好boost了,当时已经可以使用了,后来发现gcc太老了,一些软件安装需要比较新的gcc支持,所以决定升级gcc,结果boost ...
随机推荐
- mysql四-2:多表查询
一 介绍 本节主题 多表连接查询 复合条件连接查询 子查询 准备表 #建表 create table department( id int, name varchar(20) ); create ta ...
- Codeforces Round #306 (Div. 2)A B C D 暴力 位/暴力 暴力 构造
A. Two Substrings time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- 洛谷P1195 口袋的天空
口袋的天空 327通过 749提交 题目提供者该用户不存在 标签云端 难度普及+/提高 时空限制1s / 128MB 提交 讨论 题解 最新讨论更多讨论 暂时没有讨论 题目背景 小杉坐在教室里,透 ...
- CSS全局声明*与body的区别
通常在写CSS前,为了保证兼容性及展示效果的一致,先会清除浏览器默认样式.此时有两种用法比较常用:1.*{}; 2.body{}; 之前我比较偏好于用*{},比较便于把控样式的设置.一直也没试过bo ...
- bzoj 1367: [Baltic2004]sequence
1367: [Baltic2004]sequence Time Limit: 20 Sec Memory Limit: 64 MB Description Input Output 一个整数R Sa ...
- JAVA多线程基础学习三:volatile关键字
Java的volatile关键字在JDK源码中经常出现,但是对它的认识只是停留在共享变量上,今天来谈谈volatile关键字. volatile,从字面上说是易变的.不稳定的,事实上,也确实如此,这个 ...
- 从零搭建SSM框架(五)Maven实现Tomcat热部署
配置tomcat 第一步:需要修改tomcat的conf/tomcat-users.xml配置文件.添加用户名.密码.权限. <role rolename="manager-gui&q ...
- 《JavaScript 实战》:JavaScript 实现拖拽缩放效果
拖拉缩放效果,实现通过鼠标拖动来调整层的面积(宽高)大小,例如选框效果.这里的拖拉缩放比一般的选框复杂一点,能设置八个方位(方向)的固定触发点,能设置最小范围,最大范围和比例缩放. 跟拖放效果一样,程 ...
- 去除UITableView多余的seperator
UIView *v = [[UIView alloc] initWithFrame:CGRectZero]; [tableView setTableFooterView:v]; [v release] ...
- indexof()函数
js 判断字符串是否包含某字符串,String对象中查找子字符,indexOf, 成功,返回索引值,失败返回 -1. 转载: http://www.cnblogs.com/fishtreeyu/arc ...