如何安装 build-essential:i386 以在 64 位系统上编译 32 位可执行文件?

int*_*_ua 6 64-bit compiling 32-bit games 14.04

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)

请注意标签。在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 hash map implementation.  Please install GCC >=
  4.4, and all necessary 32-bit C++ development libraries.
Run Code Online (Sandbox Code Playgroud)

留言,但

-- Could NOT find Threads (missing:  Threads_FOUND) 
Can't locate XML/LibXML.pm in @INC (you may need to install the XML::LibXML module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at xml/list.pl line 6.
BEGIN failed--compilation aborted at xml/list.pl line 6.
Run Code Online (Sandbox Code Playgroud)

还在。我是否必须手动寻找所有 i386 build-essential 的依赖项?

dob*_*bey 5

是的,对于尚未在 Ubuntu 中或已添加的 PPA 中打包的任何内容,您必须手动安装编译它所需的所有依赖项。对于已经在 Ubuntu 中打包的任何东西,您都可以运行apt-get build-dep $package它并安装该包的构建依赖项,但是,如果在 Ubuntu 中构建的版本中使用的依赖项有任何其他或更改的依赖项,您仍然需要手动安装这些依赖项附加或更改的依赖项。

  • 好的,安装 `gcc-multilib g++-multilib` 和 build-deps 就足够了。 (10认同)