2、protobuf编译
>1 ./autogen.sh
出现错误:+ sed -i -e s/RuntimeLibrary="5"/RuntimeLibrary="3"/g;
s/RuntimeLibrary="4"/RuntimeLibrary="2"/g; gtest/msvc/gtest-md.vcproj gtest/msvc/gtest.vcproj gtest/msvc/gtest_main-md.vcproj gtest/msvc/gtest_main.vcproj gtest/msvc/gtest_prod_test-md.vcproj gtest/msvc/gtest_prod_test.vcproj gtest/msvc/gtest_unittest-md.vcproj gtest/msvc/gtest_unittest.vcproj
+ autoreconf -f -i -Wall,no-obsolete
./autogen.sh: 38: ./autogen.sh: autoreconf: not found
解决方法:$sudo apt-get install autoconf
$sudo apt-get install automake
$sudo apt-get install libtool
>2 ./configure
>3 make
>4 make check
>5 make clean
>6 ./configure --host=arm-linux CC=$toolchainPath/arm-linux-gnueabihf-gcc CXX=$toolchainPath/arm-linux-gnueabihf-g++ --with-protoc=protoc prefix=$installPath
出现错误:checking for arm-linux-gcc... $/home/wolf/ti-processor-sdk-linux-am57xx-evm-03.03.00.04/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-gcc
checking whether the C compiler works... no
configure: error: in `/home/wolf/Downloads/protobuf-2.6.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
解决方法:
./configure --host=arm-linux CC=/home/wolf/ti-processor-sdk-linux-am57xx-evm-03.03.00.04/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-gcc CXX=/home/wolf/ti-processor-sdk-linux-am57xx-evm-03.03.00.04/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-g++ --with-protoc=protoc prefix=/home/wolf/Downloads/test
CC:表示GCC安装目录
CXX :表示G++安装目录
prefix:表示安装目录
>7 make
>8 make check (亲测加这条指令会出现错误,而且影响后面的make install,但是不需要这条指令后面都会通过,且不影响使用)
>9 make install
>10 检查protobuf版本:切换到安装protobuf的lib目录下运行 $readelf -h libprotobuf-lite.a,machine下是ARM .
本文介绍了Protobuf的编译步骤及解决过程中遇到的问题,包括安装必要的依赖包、配置跨平台编译参数等,并提供了具体的解决方法。
4948

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



