protobuf在linux环境下c代码生成及测试
来源:互联网 发布:apache 允许目录列表 编辑:程序博客网 时间:2024/06/06 10:02
1.下载
protobuf-2.5.0.tar.gz源码上传到http://download.csdn.net/download/a493203176/9789098
2.安装
使用tar -zxf protobuf-2.5.0.tar.gz命令解压后得到是protobuf-2.5.0的源码,
cd protobuf-2.5.0 进入目录
假如你希望编译成功后输出的目录为/home/work/protobuf/ 则输入如下两条命令:
./configure --prefix=/home/work/protobuf/
make && make install
编译成功后将export PATH=/home/work/protobuf/bin:$PATH加入到环境变量中
最后输入 protoc --version命令,如显示libprotoc 2.5.0则安装成功
3. 安装protobuf c编译器(需要联网)
sudo apt-get install protobuf-c-compoler没有网情况下 手动下载protobuf c安装包
http://download.csdn.net/download/lk1592/8980395
# ./configure CXXFLAGS=-I/home/work/protobuf/include LDFLAGS=-L/home/work/protobuf/lib
# make && make install
4.编译文件
sudo protoc-c student.proto --c_out=./test/说明--c_out=指定生成代码的目录
5. 如果建立一个测试工程
点击打开链接
我测试好的工程:http://download.csdn.net/detail/a493203176/9793853
6. 测试命令(附近有我测试过的例子)
test$ gcc -o test test.c student.pb-c.c protobuf/protobuf-c
0 0
- protobuf在linux环境下c代码生成及测试
- 在C语言环境下使用google protobuf
- 在C语言环境下使用google protobuf
- linux下protobuf环境安装
- protobuf-c 在arm linux 嵌入式平台的使用 protobuf和Json对比测试
- linux 下安装protobuf-c
- 在Unity.ulua环境下如何生成lua的protobuf文件
- linux环境下安装protobuf详解
- 如何在Linux环境下在CodeBlock中安装使用Google Protobuf
- linux下安装protobuf及常见错误
- Linux Heartbeat实现高可用集群及在VirtualBox虚拟环境下的测试
- 在windows环境下写linux代码
- Linux下protobuf-c的安装
- google protobuf 在Linux下使用
- protobuf生成rpcserver代码
- protobuf代码生成
- Mac 环境下编译Protobuf 生成多种语言文件
- 在Linux环境下搭建Java Web测试环境
- 给QWidget添加工具栏
- 2.定时器
- 【C++】队列容器 头文件 #include<queue> 解读
- Spark学习00---介绍及安装配置
- java多线程之线程运行状态
- protobuf在linux环境下c代码生成及测试
- Android 触摸事件分发和拦截机制
- sort-list
- php7新特性及升级
- @Controller注解
- Blender常用快捷键
- Activity启动方式
- Mysql数据库sql_mode模式
- webapi的post和get请求总结