找不到 gcc-arm-linux-gnueabi 命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14180185/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
gcc-arm-linux-gnueabi command not found
提问by user1952441
I am trying to install the gnu arm toolchain for ubuntu. I first downloaded the tar from CodeSourcery. However when I go into the bin folder, I cannot run any of the binaries. I have tried with ./ and without and putting it in the PATH and it keeps telling me "Command not Found" yet the file is there in the folder right in front of me. Then I tried sudo apt-get install gcc-arm-linux-gnueabi except after it says it has installed successfully, I cannot find it with whereis gcc-arm-linux-gnueabi. Can anyone help?
我正在尝试为 ubuntu 安装 gnu arm 工具链。我首先从 CodeSourcery 下载了 tar。但是,当我进入 bin 文件夹时,我无法运行任何二进制文件。我试过使用 ./ 和不使用并将其放入路径中,它一直告诉我“找不到命令”,但该文件位于我面前的文件夹中。然后我尝试了 sudo apt-get install gcc-arm-linux-gnueabi 除非它说它已成功安装,但我无法使用 whereis gcc-arm-linux-gnueabi 找到它。任何人都可以帮忙吗?
回答by user1055604
try the following command:
尝试以下命令:
which gcc-arm-linux-gnueabi
Its very likely the command is installed in /usr/bin
.
该命令很可能安装在/usr/bin
.
回答by mvp
CodeSourcery convention is to use prefix arm-none-linux-gnueabi-
for all executables, not gcc-arm-linux-gnueabi
that you mention. So, standard name for CodeSourcery gcc would be arm-none-linux-gnueabi-gcc
.
CodeSourcery 约定是arm-none-linux-gnueabi-
对所有可执行文件使用前缀,而不是gcc-arm-linux-gnueabi
您提到的。因此,CodeSourcery gcc 的标准名称是arm-none-linux-gnueabi-gcc
.
After you have installed CodeSourcery G++, you need to add CodeSourcery directory into your PATH
.
安装 CodeSourcery G++ 后,您需要将 CodeSourcery 目录添加到您的PATH
.
Typically, I prefer to install CodeSourcery into directory like /opt/arm-2010q1
or something like that. If you don't know where you have installed it, you can find it using locate arm-none-linux-gnueabi-gcc
, however you may need to force to update your locate db using sudo updatedb
before locate
will work properly.
通常,我更喜欢将 CodeSourcery 安装到类似的目录/opt/arm-2010q1
中。如果你不知道你在哪里安装它,你可以使用 找到它locate arm-none-linux-gnueabi-gcc
,但是你可能需要强制更新你的 locate db usingsudo updatedb
才能locate
正常工作。
After you have identified where your CodeSourcery is installed, add it your PATH by editing ~/.bashrc
like this:
在确定 CodeSourcery 的安装位置后,通过如下编辑将其添加到 PATH ~/.bashrc
:
PATH=/opt/arm-2010q1/bin:$PATH
Also, it is customary and very convenient to define
此外,习惯上也很方便地定义
CROSS_COMPILE=arm-none-linux-gnueabi-
in your .bashrc
, because with CROSS_COMPILE
defined, most tools will automatically use proper compiler for ARM compilation without you doing anything.
在您的 . 中.bashrc
,因为CROSS_COMPILE
定义了,大多数工具将自动使用适当的编译器进行 ARM 编译,而无需您执行任何操作。
回答by strowger
You have installed a toolchain which was compiled for i686 on a box which is running an x86_64 userland.
您已经在运行 x86_64 用户空间的机器上安装了为 i686 编译的工具链。
Use an i686 VM.
使用 i686 虚拟机。
回答by Stacey Richards
Are you compiling on a 64-bit OS? Try:
您是在 64 位操作系统上编译吗?尝试:
sudo apt-get install ia32-libs
I had the same problem when trying to compile the Raspberry Pi kernel. I was cross-compiling on Ubuntu 12.04 64-bit and the toolchain requires ia32-libs to work on on a 64-bit system.
我在尝试编译 Raspberry Pi 内核时遇到了同样的问题。我在 Ubuntu 12.04 64 位上交叉编译,工具链需要 ia32-libs 才能在 64 位系统上工作。
See http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
见http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
回答by liteflier
Its a bit counter-intuitive. The toolchain is called gcc-arm-linux-gnueabi. To invoke the tools execute the following: arm-linux-gnueabi-xxx
这有点违反直觉。该工具链称为 gcc-arm-linux-gnueabi。要调用这些工具,请执行以下操作:arm-linux-gnueabi-xxx
where xxx is gccor aror ld, etc
其中 xxx 是gcc或ar或ld等
回答by Jeegar Patel
if you are on 64 bit os then you need to install this additional libraries.
如果您使用的是 64 位操作系统,则需要安装此附加库。
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
回答by axodus
got the same error when trying to cross compile the raspberry pi kernel on ubunto 14.04.03 64bitunder VM. the solution was found here:
尝试在 ubunto 14.04.03 64 位虚拟机下交叉编译 raspberry pi 内核时遇到相同的错误。解决方案在这里找到:
-Install packages used for cross compiling on the Ubuntu box.
- 在 Ubuntu 机器上安装用于交叉编译的软件包。
sudo apt-get install gcc-arm-linux-gnueabi make git-core ncurses-dev
-Download the toolchain
- 下载工具链
cd ~
git clone https://github.com/raspberrypi/tools
-Add the toolchain to your path
- 将工具链添加到您的路径
PATH=$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
notice the x64 version in the path command
注意路径命令中的 x64 版本
回答by Ahmed Mkaouar
fixed, using:
固定,使用:
sudo apt-get install gcc-arm*
回答by RookieGuy
If you are on a 64bit build of ubuntu or debian (see e.g. 'cat /proc/version') you should simply use the 64bit cross compilers, if you cloned
如果您使用的是 64 位版本的 ubuntu 或 debian(参见例如“cat /proc/version”),您应该简单地使用 64 位交叉编译器,如果您进行了克隆
git clone https://github.com/raspberrypi/tools
then the 64bit tools are in
那么 64 位工具就在
tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64
use that directory for the gcc-toolchain. A useful tutorial for compiling that I followed is available here Building and compiling Raspberry PI Kernel(use the -x64 path from above as ${CCPREFIX})
将该目录用于 gcc-toolchain。我遵循的一个有用的编译教程可以在这里找到构建和编译 Raspberry PI 内核(使用上面的 -x64 路径作为 ${CCPREFIX})
回答by sunil kumar singh
I was also facing the same issue and resolved it after installing the following dependency:
我也面临同样的问题并在安装以下依赖项后解决了它:
sudo apt-get install lib32z1-dev