问题如下:
liu@liu-v:/mnt/hgfs/C/2-22/test$ arm-linux-gcc -o main main.c
/usr/local/arm/5.4.0/usr/bin/../libexec/gcc/arm-none-linux-gnueabi/5.4.0/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
提示缺少libmpfr.so.4文件
解决方法:
查找libmpfr.so.4文件
liu@liu-v:/mnt/hgfs/C/2-22/test$ locate libmpfr.so.4
/snap/core/11993/usr/lib/x86_64-linux-gnu/libmpfr.so.4
/snap/core/11993/usr/lib/x86_64-linux-gnu/libmpfr.so.4.1.4
/snap/core/8268/usr/lib/x86_64-linux-gnu/libmpfr.so.4
/snap/core/8268/usr/lib/x86_64-linux-gnu/libmpfr.so.4.1.4
把找到的libmpfr.so.4文件复制到/usr/lib
liu@liu-v:/mnt/hgfs/C/2-22/test$ sudo cp /snap/core/8268/usr/lib/x86_64-linux-gnu/libmpfr.so.4* /usr/lib
liu@liu-v:/mnt/hgfs/C/2-22/test$ arm-linux-gcc -o main main.c
liu@liu-v:/mnt/hgfs/C/2-22/test$ ls
main main.c
liu@liu-v:/mnt/hgfs/C/2-22/test$
问题解决!!!