使用交叉编译器时缺少 libmpfr.so.6

missing libmpfr.so.6 when using a cross-compiler

我正在使用 Ubuntu 18.04

我使用 buildroot 构建了一个 mips 交叉编译器,但是当我尝试测试它是否可行时,我收到了这条消息

/home/daisy/repos/repo/buildroot/output/host/bin/../libexec/gcc/mipsel-buildroot-linux-uclibc/9.3.0/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory

我搜索了解决方案,其中之一是这样说的:

sudo pacman -S mpfr

好吧,我的 Linux 不是 archlinux,这对我不起作用。 有人请告诉我如何处理它。

在Ubuntu中,apt命令(Advanced Packaging Tool)用于执行安装新软件等功能包,升级现有软件包,更新包列表索引,甚至升级整个Ubuntu系统。

试试这个命令:-

sudo apt-get update
sudo apt install libmpfr6

这将安装共享库:libmpfr.so.6 到您的 Ubuntu 系统。

希望对您有所帮助!

以上关于在您的主机系统上安装 libmpfr 的建议是错误的。 Buildroot 应该有构建 libmpfr,它应该出现在 host/lib 中,并且由于它具有适当的 RPATH 而被交叉编译器拾取。如果它不起作用,我们需要找出原因,但正确的做法是不要在您的主机系统上安装 libmpfr。