【问题标题】:How to compile and execute 32bit C program on 64bit Windows如何在 64 位 Windows 上编译和执行 32 位 C 程序
【发布时间】:2018-02-26 09:01:00
【问题描述】:

我正在使用基于 Intel 的 64 位机器,并希望在我的命令提示符下编译和运行 32 位 C 代码。我已经通过(Linux 的 Windows 子系统)安装了 bash,并且正在使用 gcc 并安装了 gcc-multilib,因此我可以使用 -m32 标记进行编译。该程序编译正常,但当我尝试运行时出现此错误:

bash: ./32test: cannot execute binary file: Exec format error

【问题讨论】:

    标签: gcc 32bit-64bit windows-subsystem-for-linux


    【解决方案1】:

    WSL 仅支持 64 位 ELF 二进制文件。

    https://github.com/Microsoft/BashOnWindows/issues/390

    您可以尝试使用本机 Windows 编译器或在 Cygwin 中进行构建。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-02
      • 2014-07-01
      • 2018-06-21
      • 1970-01-01
      • 2012-01-18
      • 2013-12-02
      • 1970-01-01
      相关资源
      最近更新 更多