Protobuf-C For Embedded Developers (and other cross compilers)

摘录自 http://code.google.com/p/protobuf-c/wiki/Examples

Protobuf-C For Embedded Developers (and other cross compilers)

TODO: move these general comments to a new page and provide an example, as promised by the page title.

Most embedded developers need to compile protobuf-c twice:

  1. they need a copy of protoc-c that runs on their build environment (the build environment is for the machine on which they develop the application.
  2. they need to have a copy of libprotobuf-c, which is the runtime library, that is compiled for the embedded platform (which we will call the target environment).

For (1), you need to install the main protobuf package, since protoc-c uses its parser and code generator libraries. Running 'configure' as usual should be fine.

For (2), you can configure with --disable-protoc which means you won't have to build the main protobuf package for the embedded platform (since you don't need to do code gen on the embedded platform). The usual details of cross-compilation for your specific embedded platform apply. Sometimes merely providing the name of the platform to configure suffices (as in, ./configure atmel)-- but other environments need a mass of overrides like CC=atmel-cc LD=atmel-ld.

If embedded developers do not modify the .proto files, then then all they really need are the generated .pb-c.ch files, and then they can skip (1). 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值