protobuf2.6.1海思平台交叉编译

一、下载protobuf2.6.1

源码地址:https://github.com/google/protobuf/releases

二、编译pc版本

1.解压protobuf-2.6.1.tar.gz

2.配置参数,本人只指定了安装目录/home/work/protobuf/pc_protobuf

./configure --prefix=/home/work/protobuf/pc_protobuf

3.make 

4.make install 

这样我们在/home/work/protobuf/pc_protobuf看见编译成功的三个文件夹。

三、编译海思版本

1.配置参数

./configure --host=arm-linux CC=arm-hisiv200-linux-gcc CXX=arm-hisiv200-linux-g++ --with-protoc=/home/work/protobuff/pc_protobuf/bin/protoc --prefix=/home/work/protobuff/arm_protobuf/

特别注意:--with-protoc的配置

/*
**Note for cross-compiling**

  The makefiles normally invoke the protoc executable that they just
  built in order to build tests.  When cross-compiling, the protoc
  executable may not be executable on the host machine.  In this case,
  you must build a copy of protoc for the host machine first, then use
  the --with-protoc option to tell configure to use it instead.  For
  example:

    ./configure --with-protoc=protoc

  This will use the installed protoc (found in your $PATH) instead of
  trying to execute the one built during the build process.  You can
  also use an executable that hasn't been installed.  For example, if
  you built the protobuf package for your host machine in ../host,
  you might do:

    ./configure --with-protoc=../host/src/protoc

  Either way, you must make sure that the protoc executable you use
  has the same version as the protobuf source code you are trying to
  use it with.

*/

2.make 

3.make install

这样我们在/home/work/protobuff/arm_protobuf/看到编译成功的三哥文件夹。

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值