protobuf 交叉编译 for arm

github 地址:https://github.com/protocolbuffers/protobuf

下载最新版3.17.3

wget https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.17.3.zip
mv v3.17.3.zip protobuf-v3.17.3.zip
unzip protobuf-v3.17.3.zip
cd protobuf-3.17.3/
./autogen.sh 
CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ ./configure --prefix=$(pwd)/install --host=arm-linux

会提示没有googletest,可以不用理他。

make && make install

受不了太慢

make -j8 && make install

cd install/lib
tree

.
├── libprotobuf.a
├── libprotobuf.la
├── libprotobuf-lite.a
├── libprotobuf-lite.la
├── libprotobuf-lite.so -> libprotobuf-lite.so.28.0.3
├── libprotobuf-lite.so.28 -> libprotobuf-lite.so.28.0.3
├── libprotobuf-lite.so.28.0.3
├── libprotobuf.so -> libprotobuf.so.28.0.3
├── libprotobuf.so.28 -> libprotobuf.so.28.0.3
├── libprotobuf.so.28.0.3
├── libprotoc.a
├── libprotoc.la
├── libprotoc.so -> libprotoc.so.28.0.3
├── libprotoc.so.28 -> libprotoc.so.28.0.3
├── libprotoc.so.28.0.3
└── pkgconfig

├── protobuf-lite.pc
└── protobuf.pc

1 directory, 17 files

file libprotobuf.so.28.0.3 

libprotobuf.so.28.0.3: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=3dc132b70a58e7012b755b18f076ff625359ef59, with debug_info, not stripped

编译好的头文件与lib文件下载包
protobuf-3.17.3-arm.tar.xz

本文链接地址:https://const.net.cn/264.html

标签: linux, arm, protobuf

添加新评论