【问题标题】:How to cross compile application for 32 bit arm architecture on amd64 system using arm-linux-gnueabihf-g++ in Ubuntu如何在 Ubuntu 中使用 arm-linux-gnueabihf-g++ 在 amd64 系统上交叉编译 32 位 arm 架构的应用程序
【发布时间】:2015-12-15 23:23:09
【问题描述】:

我是 arm-linuxgnueabihf-g++ 的新手。我正在使用 Ubuntu 14.04 并安装了 arm-linuxgnueabihf-g++-4.7 的 amd64 机器。我想交叉编译针对 32 位 arm 架构的应用程序。

我运行命令:

arm-linux-gnueabihf-g++ -m32 hello.cpp -o hello.

但它给了我错误:arm-linux-gnueabihf-g++: error:

unrecognized command line option ‘-m32’.

而且互联网上似乎很少有关于 arm-linux-gnueabihf-g++ 的文档。

谁能帮帮我?

【问题讨论】:

  • 不确定,但也许你一直使用谷歌搜索错误。如果我申请gcc "-m32",我会得到很多可能对您有所帮助的结果。

标签: c++ linux arm cross-platform cross-compiling


【解决方案1】:

-m32 是一个 x86 选项。它在 ARM 上不受支持(或不需要),因为 32 位和 64 位代码使用不同的工具链。

64 位 ARM (AArch64) 工具链称为 aarch64-linux-gnu。

【讨论】:

  • 谢谢。如果我想在 amd64 机器上编译针对 32 位 ARM 的代码,我应该使用什么工具链?
  • 你有的,只要去掉'-m32'。
猜你喜欢
  • 1970-01-01
  • 2014-03-14
  • 2015-12-16
  • 2010-10-04
  • 2019-03-12
  • 1970-01-01
  • 1970-01-01
  • 2017-07-05
  • 1970-01-01
相关资源
最近更新 更多