boost+mingw+codelite+thread配置

mingw+boost
1、修改 bootstrap.bat :
    set toolset=gcc
2、编译boost.thread :
    在dos命令行中输入gcc,如果提示找不到,则需把c:\mingw1.6.4\bin加入到PATH中
     bjam.exe -toolset=gcc --with-thread --build-type=complete variant=release
2、setting -> build setting -> gnu g++ -> advance中添加include和libs的路径
    include path:   D:\boost_1_49_0
    libraries path:  D:\boost_1_49_0\stage\lib
3、project settings ->global settings -> libraries 添加:
   libboost_thread-mgw46-mt-1_49
ctrl+f9

附验证程序:
#include <stdio.h>
#include <iostream>
#include <boost/thread.hpp>
using namespace std;
using namespace boost;

int main(int argc, char **argv)
{
	printf("hello world\n");
	this_thread::sleep(posix_time::seconds(2));
	cout << "ok...." << endl;
	this_thread::get_id();
	return 0;
}
如果提示找不到dll,还需要把 D:\boost_1_49_0\stage\lib\libboost_thread-mgw46-mt-1_49.dll放到合适的位置


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值