【问题标题】:Raspberry Pi crosscompile on Ubuntu 13.10 "libstdc++.so.6" not found未找到 Ubuntu 13.10“libstdc++.so.6”上的 Raspberry Pi 交叉编译
【发布时间】:2014-03-05 17:04:42
【问题描述】:

我已遵循tutorial on SE 并尝试了Hertavillebootc 的额外步骤,但我仍然收到提示原始SE 问题的错误。我被难住了。

在我收到错误之前,我需要执行五个步骤:

sudo apt-get install git rsync cmake lib32z1 lib32ncurses5 lib32bz2-1.0
git clone git://github.com/raspberrypi/tools.git
export PATH=$PATH:$HOME/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin
. ~/.bashrc
arm-linux-gnueabihf-gcc -v

错误:

arm-linux-gnueabihf-gcc: error while loading shared libraries: 
     libstdc++.so.6: cannot open shared object file: No such file or directory

libstdc++.so.6 存在于教程中提到的所有三个目录树以及./lib/x86_64-linux-gnu/libstdc++.so.6 中,但是将相关的目录树添加到路径中并没有帮助(见下文)。我怀疑没有设置库路径,但我不知道那是什么。


我在运行 Ubuntu 13.10 的虚拟机中执行此操作,该虚拟机带有 netbeans 和其他工具,外加安装了 LAMP 堆栈。 netbeans 可以很好地构建和运行 C/C++ 可执行文件(显然 IO 可以从命令行执行相同的操作)。

我尝试过的其他事情都没有成功

export PATH=$PATH:$HOME/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/lib

Hertaville 建议添加 32 位架构:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6-i386 lib32stdc++6 zlib1g:i386

还有“build-essential”包:

sudo apt-get install build-essential git

这也没有帮助。为了以防万一,我也重新启动了。

【问题讨论】:

    标签: raspberry-pi cross-compiling ubuntu-13.10


    【解决方案1】:

    正如预期的那样,答案很简单——安装 lib32stdc++6

    上面的第一行应该是:

    sudo apt-get install libc6-i386 lib32z1 lib32stdc++6
    

    【讨论】:

      猜你喜欢
      • 2016-09-22
      • 2014-04-10
      • 2012-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多