
boost相关
文章平均质量分 78
jwybobo2007
站在脚下看世界
展开
-
64位boost编译
<br />例:<br />bjam --toolset=msvc-10.0 address-model=64 ... ...原创 2011-05-26 16:43:00 · 803 阅读 · 0 评论 -
boost ptime 与 time_t等的转换
<br /> <br />#include <boost/date_time/posix_time/posix_time.hpp><br />#include <boost/date_time/gregorian/gregorian.hpp><br />#include <iostream><br />#include <stdint.h><br />int main()<br />{<br /> using namespace boost::posix_time;<br /> using namespac原创 2010-10-16 19:57:00 · 9813 阅读 · 0 评论 -
boost posix_time格式化输出
1.格式化输出本地时间:boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();boost::posix_time::time_facet* tf = new boost::posix_time::time_facet("%Y-%m-%d %H:%M:%S");std::stringstream原创 2012-08-03 15:56:03 · 6115 阅读 · 2 评论 -
boost function 实现
http://www.cppblog.com/Streamlet/archive/2011/01/16/138615.html转载 2013-04-27 13:08:26 · 662 阅读 · 0 评论 -
boost计算随机数和计算crc32简单示例
// 计算随机数(同一时刻值不会重复)uint32_t createRandam32(){ static boost::mt19937 mt((uint32_t)time(NULL)); return mt();}// 计算指定缓冲的crc32检验值uint32_t crc32( const void* data, size_t size ){ boost::crc_32_ty原创 2013-02-18 17:14:35 · 2509 阅读 · 0 评论 -
boost库命名规则
Boost官网的《Geting Started On Windows》(http://www.boost.org/doc/libs/1_38_0/more/getting_started/windows.html)提到了Boost库的命名,摘录如下:以 libboost_regex-vc71-mt-d-1_34.lib 为例:lib 前缀:除了Microsoft Windows转载 2013-04-11 15:16:09 · 802 阅读 · 0 评论 -
boost bind 实现方法
一直比较好奇 boost::bind 里面占位符和参数的顺序是怎么实现的,也一直看不太懂这方面源代码,昨晚好好看了下,终于有点弄懂了。小记一笔,与大家分享。先看一个简单的用例:#include int foo(bool a, int b, double c){ return 0;} int main(){转载 2013-04-27 13:07:09 · 711 阅读 · 0 评论 -
boost中tokenizer的用法举例
例一:// simple_example_1.cpp#include#include#includeint main(){ using namespace std; using namespace boost; string s = "This is, a test"; tokenizer<> tok(s); for(tokenizer<>::ite翻译 2014-04-02 19:22:51 · 1194 阅读 · 0 评论 -
使用mips交叉编译器编译boost
编译方式和arm交叉编译类似,不过我用的交叉编译器版本非常老,是3.40的boost库,可以使用任意版本,下载地址:http://www.boost.org编译方法1. 下载解压boost库到任意位置,如/home/boost_1_48_0/2. 切换目录至/home/boost_1_48_0,运行bootstrap.sh,此时在当前目录下会生成bjam这个原创 2013-04-25 15:52:04 · 4647 阅读 · 0 评论 -
boost arm 交叉编译
下载解压boost,我现在用的是1.48,安装交叉编译器至指定位置,设置编译器路径到 PATH1.首先运行boost解压目录下的./bootstrap.sh 2.修改生成的project-config.jam文件修改:using gcc : arm : arm-none-linux-gnueabi-gcc ; 修改(这边不改也没事):option.s原创 2012-02-09 08:35:16 · 12648 阅读 · 7 评论 -
boost编译开关宏参考手册(中文)
http://boost.ez2learn.com/libs/config/doc/html/boost_config/boost_macro_reference.htmlBoost 宏参考描 述缺陷的宏描 述可选特性的宏描 述可能的 C++0x 特性的宏描 述不被支持的 C++0x 特性的宏Boost 辅助宏Boost 信息宏用 於分隔源代码的宏原创 2013-03-26 16:23:50 · 5242 阅读 · 0 评论 -
使用android ndk编译boost库
由于以往我写过不少使用boost库开发的项目,而最近准备移植一些代码到android上(上层界面以及jni层我不管,也没研究过,现在只完成代码的移植编译,具体如何调用,由其它人负责),所以先要解决的就是boost库本身的移植问题。在google上找了一些相关的资料,然后在http://stackoverflow.com上找到一个给力的帖子:http://stackoverflow.com/原创 2013-03-19 09:44:18 · 11434 阅读 · 9 评论 -
boost asio serial_port 读写串口
以下是serial_port同步读写串口设备的示例代码: #include #include #include using namespace std;int main(int argc, char* argv[]){ try { boost::asio::io_service io; boost::asio::serial_port sp(io, "COM1")原创 2011-11-28 12:33:47 · 10881 阅读 · 0 评论 -
Linux/ubuntu下的boost库安装
我一直都没有写博客的习惯,最近正好在研究linux下的开发(目前也只是粗粗的研究),且用到了boost库,就乘此机会写点什么,最起码记录一下我在安装boost的一些步骤,主要给和我一样的linux开发新手们提供点借鉴。 1.首先执行:sudo apt-get insta原创 2010-08-18 22:45:00 · 6659 阅读 · 5 评论 -
ios版boost库编译
#!/bin/bash# 请自行修改路径,cd到boost解压后的目录下dir=`dirname $0`cd "$dir/../../public_libs/boost_1_56_0"# 如果库文件已存在,直接退出if [ -e ./stage/lib/libboost_date_time.a ]; then echo "libraries exist. no need to bui...原创 2016-12-29 18:04:33 · 3153 阅读 · 1 评论