apt-get install build-essential:i386 根本不起作用:
The following packages have unmet dependencies:
build-essential:i386 : Depends: gcc:i386 (>= 4:4.4.3) but it is not going to be installed
Depends: g++:i386 (>= 4:4.4.3) but it is not going to be installed
Run Code Online (Sandbox Code Playgroud)
请注意14.04标签。在64 位机器上编译 32 位二进制文件时遇到问题的答案
已经过时。此外,没有./configure脚本可以在 64 位系统上使用Compile 32 位答案。
我正在尝试从 quietust 分支编译 DFHack:https : //github.com/quietust/dfhack/
apt-get install gcc-multilib g++-multilib 删除了
CMake Error at depends/protobuf/CMakeLists.txt:60 (MESSAGE):
Could not find a working …Run Code Online (Sandbox Code Playgroud) 那么 11.10 的 multiarch 功能是否意味着 64 位用户将能够安装 32 位“.debs”而无需求助于“force--architecture”命令?
注意:我浏览了一些建议的“类似问题”,但没有发现任何看起来结论性的内容。另外,他们中的大多数似乎已经有 6 岁了(从 2014 年开始),所以我希望有一些更新的东西(并且更有可能“正常工作”)。
我有一个 64 位 Ubuntu 系统,运行良好。我希望能够构建一个 32 位版本的“hello,world”。这主要是一种学术追求,但让它发挥作用会很方便。如果使用“-m32”编译“正常工作”,那就太好了,但事实并非如此。更糟糕的是,我的记忆是,这曾经“正常工作”(在旧版本的 64 位 Linux 中),但现在不再工作了。
观察:
$ cat hello.c
#include <stdio.h>
int main() { puts("hello, world"); return 0; }
$ gcc -m32 hello.c
In file included from hello.c:1:0:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
#include <bits/libc-header-start.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
$
Run Code Online (Sandbox Code Playgroud)
一番探索表明安装这些软件包(见下文)可能会有所帮助,所以我这样做了:
apt-get install libc6-dev-i386-x32-cross
Run Code Online (Sandbox Code Playgroud)
安装了以下内容:
The following NEW packages will be installed:
libc6-dev-i386-x32-cross libc6-dev-x32-cross libc6-i386-x32-cross
libc6-x32-cross linux-libc-dev-x32-cross
Run Code Online (Sandbox Code Playgroud)
之后,通过一点点捏造,我能够编译它,但不能链接。链接阶段给出以下错误消息:
/usr/bin/ld: cannot find Scrt1.o: No such file or …Run Code Online (Sandbox Code Playgroud)