libevent&&protobuf交叉编译笔记

1.cd指令进入libevent+google_buffer.zip文件所在的目录
cd /user1/yueyc/cross_tool/test(参考)
2.unzip指令解压
unzip libevent+google_buffer.zip 
3.解压后看到libevent-2.0.22-stable  protobuf-2.6.1
[root@localhost test]# ls
libevent+google_buffer.zip  libevent-2.0.22-stable  protobuf-2.6.1
4.在源码路径下建立libevent_install protobuf_install libevent和protobuf的安装目录
mkdir libevent_install protobuf_install






5.交叉编译制作libevent
1.进入libevent源码安装路径
cd libevent-2.0.22-stable
2.交叉编译制作libevnet交叉工具之配置
./configure --prefix=/user1/yueyc/cross_tool/test/libevent_install --host=arm-hisiv400-linux CC=arm-hisiv400-linux-gcc CXX=arm-hisiv400-linux-g++
3.libevent编译与安装
执行make结束后,执行make install 即可看到在libevent_install路径下的bin、include、lib目录

6.交叉编译制作protobuf工具
0.进入protobuf源码根目录
cd protobuf-2.6.1/
1.制作交叉编译库及工具,需要先在宿主机上部署安装protoc工具,如果不部署宿主机,直接交叉编译会提示没有protoc工具。
./configure //默认配置即可
make
make check //可以省略
make install //默认安装在宿主机上usr下目录。
make distclean //distclean 以便下一步的交叉编译

2.导出LD_LIBRARY_PATH,如果不导出的话 会在交叉编译make时,遇到找不到libprotobuf.so.8的问题
(protoc: error while loading shared libraries: libprotobuf.so.8: cannot open shared object file: No such file or directory)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

3.配置protobuf
./configure --prefix=/user1/yueyc/cross_tool/test/protobuf_install --host=arm-hisiv400-linux CC=arm-hisiv400-linux-gcc CXX=arm-hisiv400-linux-g++ --with-protoc=protoc --disable-shared
4.编译及安装protobuf工具
make //编译
make install //make后执行安装,在目录protobuf_install下即可看到bin、include、lib目录
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值