【问题标题】:Cannot compile x86 in GCC crunchbang无法在 GCC crunchbang 中编译 x86
【发布时间】:2014-03-03 02:27:37
【问题描述】:

我似乎无法使用 GCC 将 C 编译为 x86。我正在使用 crunchbang。

简单的C测试文件:

#include <stdio.h>

int main(){
    printf("Test x86");
}

当编译时:
gcc -o 64 test.c
我没有得到任何错误或输出。 但是,当使用:
gcc -o 64 -m32 test.c
编译时,我会收到:

In file included from /usr/include/features.h:356:0,
                 from /usr/include/stdio.h:28,
                 from test.c:1:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:359:27: fatal error: bits/wordsize.h: No such file or directory
compilation terminated.

现在,浏览这些文件,似乎它们位于错误的文件夹中,因为。我不确定在这里做什么。

/usr/include/features.h:586的内容

#  include <x86_64-linux-gnu/sys/cdefs.h>

在第 359 行出现错误。该行如下所示:

#include <bits/wordsize.h>

该文件实际上位于此处: /usr/include/x86_64-linux-gnu/bits/wordsize.h

【问题讨论】:

  • 这里只是猜测,但请确保您安装了gcc multilib 之类的东西,所以您确实拥有 32 位库等。
  • 很好的建议。我会重新安装它以确保:)
  • 这很尴尬。感谢您的帮助!

标签: c gcc compiler-construction 32bit-64bit


【解决方案1】:

GCC 应支持或运行multilib 以消除此错误。

【讨论】:

  • 我试图删掉令人尴尬的“you're”,因为它的意思是“your”,但它不会让我这样做,因为它少于 6 个字符。 语法纳粹>
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-06-30
  • 1970-01-01
  • 1970-01-01
  • 2020-05-18
  • 2013-01-29
  • 1970-01-01
  • 2015-07-20
相关资源
最近更新 更多