驅動程式 - Linux Device Driver(LDD) - 解決libmpfr.so.4: cannot open shared object file問題



問題如下:

$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make zImage -j4
      CHK     include/linux/version.h
      CHK     include/linux/utsrelease.h
      CC      scripts/mod/empty.o
    /opt/gcc-4.9.4_arm32/bin/../libexec/gcc/arm-linux-gnueabi/4.9.4/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
    make[2]: *** [scripts/Makefile.build:230: scripts/mod/empty.o] Error 1
    make[1]: *** [scripts/Makefile.build:365: scripts/mod] Error 2
    make: *** [Makefile:468: scripts] Error 2
    make: *** Waiting for unfinished jobs....
      SYMLINK include/asm -> include/asm-arm

解法如下:

$ cd
$ wget https://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.gz
$ tar xf mpfr-3.1.6.tar.gz
$ cd mpfr-3.1.6
$ ./configure --prefix=/opt/mpfr-3.1.6
$ make -j4
$ sudo make install
$ export LD_LIBRARY_PATH=/opt/mpfr-3.1.6/lib:$LD_LIBRARY_PATH