需要交叉编译环境故安装交叉编译环境
1.在宿主机的/usr/local/arm目录存放交叉编译器
mkdir /usr/local/arm
2.解压交叉编译器包至/usr/local/arm/目录下
tar xzvf 4.3.1-eabi-armv6-up-cup6410.tar.gz -C /usr/local/arm
-C 表示以覆盖的形式到/usr/local/arm目录下
3.修改系统编译器默认搜索路径配置文件PATH及LD_LIBRARY_PATH环境变量
vim ~/.bashrc
修改后内容如下:
#UP-CUP6410II
PATH=$PATH:$HOME/bin:/usr/local/arm/4.3.1-eabi-armv6/usr/bin/
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/arm/4.3.1-eabi-armv6/gmp/lib:/usr/local/arm/4.3.1-eabi-armv6/mpfr/lib
export LD_LIBRARY_PATH
退出并保存
4.重启配置
source ~./bashrc
5.查看外延库路径
echo $LD_LIBRARY_PATH