这个东西听说很牛皮,15年就开始研发了,但我今天才接触到,感受到大厂的预见跟资源,因为要移植到arm板上,所以要进行交叉编译,也是遇到了一些坑,记录一下以免以后忘记
1.下载源码
https://github.com/ApolloAuto/apollo-DuerOS/tree/master/CarLife-Vehicle-Lib
CarLife-Vehicle-Lib这个目录下是linux版的车机端源码
2.进入目录,解压protobuf-2.5.0.tar.gz
3.cd protobuf-2.5.0/
4.直接编译
./configure(默认安装路径/usr/local/include lib)
make
make check
sudo make install
5.交叉编译
./configure --build=x86_64-unknown-linux-gnu --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ --with-protoc=protoc --prefix=/usr/protobuf --disable-shared
make
make check(有错,不用理)
sudo make install
–build=x86_64-unknown-linux-gnu 编译的机器
–host=arm-linux-gnueabihf 运行机器
CC=arm-linux-gnueabihf-gcc c编译工具链
CXX=arm-linux-gnueabihf-g++ c++编译工具链
–prefix=/usr/protobuf 安装路径
如果有报错找不到protoc的话,需要安装
sudo apt-get install protobuf-compiler
6.编译carlife源码
6.1 在makefile中加入工具链

#Author:
# Liu CaiQuan
#Date:
# 7th Semptember 2015

最低0.47元/天 解锁文章
968

被折叠的 条评论
为什么被折叠?



