我使用protobuf版本号:protobuf-2.5.0


vs版本:vs2010


解压protobuf-2.5.0,解压后内容如下:



ProtoBuf如何在c++中使用



进入上面画线的vsprojects文件夹


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用



ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用


接着打开记事本,注意我的用词是记事本,而非文本文档

建两个文件:


ProtoBuf如何在c++中使用



guozhu.proto :

ProtoBuf如何在c++中使用


上面文件写好后,保存时,注意如下:
ProtoBuf如何在c++中使用



test.bat :


ProtoBuf如何在c++中使用




ProtoBuf如何在c++中使用


此时双击test.bat文件


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用



ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用



ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用



ProtoBuf如何在c++中使用


到此为止,protobuf在C++的环境搭建和准备工作已经做完,测试一下吧:


ProtoBuf如何在c++中使用


运行如下:
ProtoBuf如何在c++中使用


注意如下:
protobuf下载包的大小是:1.78M,其它的我试验过,编译会失败


ProtoBuf如何在c++中使用


ProtoBuf如何在c++中使用


FR:海涛高软(hunk Xu) QQ技术交流群:386476712

相关文章: