出错提示为:
/opt/brcm-arm/bin/../libexec/gcc/arm-brcm-linux-uclibcgnueabi/4.5.3/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory
或者:
configure: error: C compiler cannot create executables
执行:
ldd /opt/brcm-arm/libexec/gcc/arm-brcm-linux-uclibcgnueabi/4.5.3/cc1
发现有库未找到:
linux-gate.so.1 => (0xf77bf000)
libmpc.so.2 => not found
libmpfr.so.4 => not found
libgmp.so.10 => not found
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf77aa000)
libelf.so.1 => /usr/lib/i386-linux-gnu/libelf.so.1 (0xf7792000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf75e3000)
/lib/ld-linux.so.2 (0xf77c0000)
解决方法,编译前执行:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/brcm-arm/lib:/usr/local/lib:/usr/lib
再用上面的命令检查依赖库,结果没有依赖库未找到了:
linux-gate.so.1 => (0xf76f4000)
libmpc.so.2 => /opt/brcm-arm/lib/libmpc.so.2 (0xf76de000)
libmpfr.so.4 => /opt/brcm-arm/lib/libmpfr.so.4 (0xf768e000)
libgmp.so.10 => /opt/brcm-arm/lib/libgmp.so.10 (0xf7631000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7620000)
libelf.so.1 => /usr/lib/i386-linux-gnu/libelf.so.1 (0xf7608000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7459000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7412000)
/lib/ld-linux.so.2 (0xf76f5000)
编译也没问题了 。