项目地址:https://code.google.com/p/snappy/

下载后,解压。

$./configure
$make

建立一个简单的测试文件a.cpp:

#include "snappy.h"
#include <string>
#include <iostream>
int main() {
std::string s = "ddsandslkadnsldsan;lkdsanf;ladnskal;fsan;lkfsjk;lfsna;lfdskfsa";
std::string d;
snappy::Compress(s.data(), s.size(), &d);
std::cout<<d<<std::endl;
std::cout<<s.size()<<" "<<d.size()<<std::endl;
return 0;
}

编译运行:

libtool --mode=compile g++ -c a.cpp
libtool --mode=link g++ -o test a.lo libsnappy.la
./test
rm test

最新文章

  1. SharePoint 2013 Nintex Workflow 工作流帮助(十)
  2. linux下python启动第三方程序,并控制关闭
  3. c++ 从标注输入流读取行
  4. GNU scientific library
  5. 动态游标(例如表名作为参数)以及动态SQL分析
  6. 十条有用的GO技术
  7. 微信跳转ticket值怎么得到?浏览器跳到微信?哪里有微信跳转接口?跳转功能能用多久?
  8. Python——pandas数据处理(python programming)
  9. VUE 前端项目优化方法
  10. Java多线程——Lock&amp;Condition
  11. 反爬虫之JS反编译:PyExecJS
  12. 10个有趣的Javascript和CSS库
  13. mysql的数据恢复
  14. Boost application performance using asynchronous I/O-ref
  15. Django中间件执行顺序
  16. Python 去掉文本中空行
  17. 【我的Android进阶之旅】解决bug:You need to use a Theme.AppCompat theme (or descendant) with this activity.
  18. jquery autocomplete jqueryui报错
  19. EF4学习链接
  20. 微信Oauth2.0网页开放授权

热门文章

  1. @XStreamAlias使用
  2. 总结iOS9中的新的方法
  3. FreeRTOS 任务计数信号量,任务二值信号量,任务事件标志组,任务消息邮箱
  4. dp之多重背包poj1276
  5. PgSQl临时表的创建
  6. shell 后台执行脚本
  7. 从文件/文件流的头字节中得到mime信息
  8. http://jadethao.iteye.com/blog/1926525
  9. c经典算法
  10. ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务