google protocol buffer lite_WINCE 总结

本文详细介绍了如何在Windows CE环境下配置并优化使用Protobuf 2.4.1的过程,包括创建Win32智能设备项目库、复制源代码文件、提供缺少的errno.h头文件、设置额外包含目录以及解决宏冲突等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在网站 http://code.google.com/p/protobuf/downloads/list上可以下载 Protobuf 的源代码。然后解压编译安装便可以使用它了。

 

使用2.4.1版本,

源代码目录下vsprojects/libprotobuf-lite.vcproj,以及自己整理的lite工程,

 

(1):Create a Win32 Smart Device Project library project, name it protobuf-lite-ce
(2):Copy all source files from protobuf-lite project to protobuf-lite-ce project in Solution Explorer
(3):Create a ce_port folder in the project's directory, and copy the errno.h header file from (Visual_Studio_Root)/VC/include into the folder. This is because Windows CE doesn't have this file, so we need to provide one. Actually, this errno.h can be a pure empty file.
(4):Add "../src;.;./ce_port" to the project's Additional Include Directories.
(5):The windef.h header file already defines OPTIONAL macro, it conflicts with Cardinality::OPTIONAL enum. So theextension_set.cc fails to compile, to solve this, add following code before enum Cardinality definition to undefine OPTIONAL:

 
#if defined(OPTIONAL)
#if defined(_MSC_VER)
#pragma message ("Unexpected OPTIONAL macro definition, #undefine OPTIONAL")
#else
#warning  "Unexpected OPTIONAL macro definition, #undefine OPTIONAL"
#endif
#undef OPTIONAL
#endif
namespace {

enum Cardinality {
  REPEATED,
  OPTIONAL
};

}  // namespace


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值