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 .