NANOPI2官方WIKI只给了64位搭建编译环境的方法,对于像我这样只有32位电脑或者只安装了32位LINUX的朋友就没有说明,下面我介绍的方法可以解决这个问题。打开synap
tic package manager按CTRL+F输入
ARM按OK进行搜索,勾选cpp-4.9-arm-linux-gnueabihf gcc-4.9-arm-linux-gnueabihf gcc-4.9-arm-linux-gnueabihf-base libc6-armhf-cross libc6-dev-armhf-cross libgcc-4.9-dev-armhf-cross libgcc1-armhf-cross libgo0-armhf-cross libsfgcc1-armhf-cross libsfstdc++6-armhf-cross libstdc++6-armhf-cross linux-libc-dev-armhf-cross pkg-config-arm-linux-gnueabihf u-boot-tools android-tools-fastboot git vim,然后选择Mark for Installation和Apply.
打开terminal
cd ~
git clone https://github.com/friendlyarm/prebuilts.git
sudo tar xf ~/prebuilts/gcc/arm-linux-gcc-4.5.1-v6-vfp.tar.xz
cd ~/prebuilts/gcc/opt
sudo cp -R * /opt
sudo vi ~/.bashrc
在最下面复制粘贴下面两行进去后输入:wq保存
export PATH=/opt/FriendlyARM/toolchain/4.5.1/bin:$PATH
export GCC_COLORS=auto
输入下面命令使上面修改生效
cd ~
. ~/.bashrc
输入下面命令测试
arm-linux-gcc -v
输出和下面一样则成功
Target: arm-none-linux-gnueabi
Configured with: /work/toolchain/build/src/gcc-4.5.1/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.5.1 --with-sysroot=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root --enable-languages=c,c++ --disable-multilib --with-cpu=arm1176j***-s --with-tune=arm1176j***-s --with-fpu=vfp --with-float=softfp --with-pkgversion=ctng-1.8.1-FA --with-bugurl=http://www.arm9.net/ --disable-sjlj-exceptions --enable-__cxa_atexit --disable-libmudflap --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-gmp=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-mpfr=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-ppl=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-cloog=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-mpc=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-libelf=/work/toolchain/build/arm-none-linux-gnueabi/build/static --enable-threads=posix --with-local-prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root --disable-nls --enable-symvers=gnu --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.5.1 (ctng-1.8.1-FA)
1