protobuf开发环境搭建

来源:互联网 发布:怎么抢淘宝秒杀的东西 编辑:程序博客网 时间:2024/05/15 00:30

1       protobuf开发环境搭建

1.1      Window

1.1.1下载protobuf包

参考地址:https://github.com/google/protobuf

1.1.2编译

1.      建立build_vs_project目录,使用cmake-gui分别构建编译x64/x86平台Debug/Release工程

2.      直接打开工程进行编译

1.2      Linux

1.2.1下载protobuf包

参考地址:https://github.com/google/protobuf

1.2.2执行脚本

./autogen.sh

1.2.3编译

1.      进入cmake目录,修改CMakeLists.txt中加入编译位数SET(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS} -m32")。

2.      返回解压目录,建立build_linux_project目录,分别构建编译x64/x86工程makefile(cmake外部构建),分别进行编译。

原创粉丝点击