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 ...
随机推荐
- ios错误码:NSError对象.code
1. URL Loading System Error Codes These values are returned as the error code property of an NSError ...
- js 判断图片是否加载完成(使用 onload 事件)
我们在写 jquery 的时候一般都会写 $(document).ready,加载完成事件还有一个就是 onload onload 与 ready 的区别是: 1.ready 是 DOM 加载完成的事 ...
- js 时间戳 转化
new Date((1524142795*1000)).toJSON().slice(11,16)
- Hibernate学习(3)- *.hbm.xml详解
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBL ...
- 分治法:快速排序求第K极值
标题其实就是nth_element函数的底层实现 nth_element(first, nth, last, compare) 求[first, last]这个区间中第n大小的元素 如果参数加入了co ...
- ZOJ 3782 G - Ternary Calculation 水
LINK:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3782 题意:给出3个数和两个符号(+-*/%) 思路:拿到题目还 ...
- 您是哪个等级的CSS开发人员?
我们在不断的学习,追求进步与提高,到底学到什么程度了,到底是 不是真的了解CSS,是哪个层次了呢.我们来对照一下. 第0级:CSS?那不是一个多人射击游戏吗? CSS? Isn't that a m ...
- hihocoder1415 后缀数组三·重复旋律3
传送门:http://hihocoder.com/problemset/problem/1415 [题解] 考虑求出两串合在一起(中间加分隔符)后缀数组,就是要求任意在两个串中的$i, j$,$\mi ...
- fetch and js异步介绍
http://www.ruanyifeng.com/blog/2012/12/asynchronous%EF%BC%BFjavascript.html Javascript异步编程的4种方法 ht ...
- CodeForces 990C
Description A bracket sequence is a string containing only characters "(" and ")" ...