无法在64位Linux上构建32位Wine

12

我正在尝试做这件事:
使用automake配置脚本在64位Linux上构建32位程序?
对我不起作用 :( 编译wine。我在config.log文件中找到了这个:

configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Wine"
| #define PACKAGE_TARNAME "wine"
| #define PACKAGE_VERSION "1.5.19"
| #define PACKAGE_STRING "Wine 1.5.19"
| #define PACKAGE_BUGREPORT "wine-devel@winehq.org"
| #define PACKAGE_URL "http://www.winehq.org"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }

配置失败,错误信息为:无法构建32位程序,您需要安装32位开发库。

7个回答

13
apt-get install gcc-multilib libasound2-dev:i386 libgsm1-dev:i386 libjpeg8-dev:i386 liblcms2-dev:i386 libldap2-dev:i386 libmpg123-dev:i386 libopenal-dev:i386 libv4l-dev:i386 libx11-dev:i386 libxinerama-dev:i386 libxml2-dev:i386 zlib1g-dev:i386 
apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386 libgnutls26:i386 libgphoto2-2:i386 libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386

帮我解决了X错误。


11
要在64位机器上构建32位的wine,您可以使用LXC(Linux容器),它是一个操作系统级别的虚拟化环境,用于运行多个隔离的Linux系统。这是目前最简单的解决方案,因为Linux(如Ubuntu或Debian)很难构建32位的wine,因为64位系统没有完整的32位开发库(参见:Bug #990982)。
因此,编译32位和64位的wine的基本方法是:
  1. 构建64位的wine
  2. 在lxc中构建32位工具
  3. 在lxc中构建32位的wine,参考之前步骤1中构建的64位wine和32位工具1
  4. 安装32位的wine
  5. 安装64位的wine
Building Biarch (Shared WoW64) Wine On Ubuntu页面上,我们可以阅读以下说明:
  1. Install the 64-bit prerequisites:

    sudo apt-get update
    sudo apt-get build-dep wine
    
  2. Build 64-bit wine:

    mkdir $HOME/wine64
    cd $HOME/wine64
    ../wine-git/configure --enable-win64
    make -j4
    
  3. Install lxc:

    sudo apt-get install lxc
    
  4. Create a 32-bit container named "my32bitbox" using the Ubuntu template and bind your home directory to the /home directory in the container:

    sudo lxc-create -t ubuntu -n my32bitbox -- --bindhome $LOGNAME -a i386
    
  5. Copy the apt configuration from the host to the lxc container:

    sudo cp -R /etc/apt /var/lib/lxc/my32bitbox/rootfs/etc
    
  6. Start the container; at the console login prompt it gives you, log in with your username and password.

    sudo lxc-start -n my32bitbox
    
  7. Now you're inside the container, in your real home directory. If you are not in the container (you do not have the prompt username@my32bitbox), then open a new terminal and:

    sudo lxc-attach -n my32bitbox
    login yourusername+password
    
  8. Now, you are in the container. Do an out-of-tree build of Wine as normal, just to get the tools. You'll have to install all the needed prerequisites first. For instance:

    sudo apt-get update
    sudo apt-get install python-software-properties git-core
    sudo apt-get build-dep wine
    mkdir $HOME/wine32-tools
    cd $HOME/wine32-tools
    ~/wine-git/configure
    make -j4
    
  9. Still inside the container, do it again, this time pointing to the 64-bit build for data, and the 32-bit tools build for tools:

    mkdir $HOME/wine32
    cd $HOME/wine32
    ~/wine-git/configure --with-wine64=$HOME/wine64 --with-wine-tools=$HOME/wine32-tools
    make -j4
    
  10. Still inside the container, install the 32-bit wine to force the last little bit of building:

    cd $HOME/wine32
    sudo make install
    
  11. While still inside the container, shut it down:

    sudo shutdown -h now
    

    This drops you back out into your real machine. Next, you need to remove all existing Wine packages. You can do this from the command line but it's probably easier with aptitude or one of the GUI package management tools. You will need wine-mono, wine-gecko, and optionally winetricks for your compiled version of wine. However, these packages may depend on the existing wine installation which may force you to remove them.

  12. Install the newly built wine into your real machine:

    cd $HOME/wine32
    sudo make install
    cd $HOME/wine64
    sudo make install
    

    Warning: When you install a locally built version of Wine, the package management system will not know it exists since it did not come from a package. Thus it is possible to later break its dependencies or install a conflicting version of wine without a warning from the package management tools. You can prevent this by creating a package or by blocking conflicting packages with apt-pinning by setting "Pin-Priority: -1" for the packages.

  13. Next, install Mono, Gecko, and optionally winetricks if you had to remove their packages because of a dependency on a conflicting wine package.

注:

  • 上述命令中的许多需要root权限。您的用户帐户需要通过sudo或切换到用户帐户来访问root。
  • 不必删除您的发行版版本并“安装”您编译的版本(32位,64位)。您只需要调用适用于Windows应用程序的个人版本即可。例如: ~/wine32/wine32 ~/.wine/path_to_winapp/my_app

配置无法在32位系统中找到Wine工具。 - zardilior

3

以下是我在Debian Wheezy上尝试过的一些方法:

dpkg --add-architecture i386
apt-get update

启用i386仓库安装

apt-get install ia32-libs libc6-dev-i386 lib32z1-dev lib32bz2-dev

安装32位库。我仍然遇到X库的问题:

configure: error: X 32-bit development files not found. Wine will be built
without X support, which probably isn't what you want. You will need
to install 32-bit development packages of Xlib/Xfree86 at the very least.
Use the --without-x option if you really want this.

但从技术上讲,这是可选的。


2
您可能会解决X错误:
sudo apt-get install xorg-dev

1
我猜您使用的是Ubuntu x64,现在它支持多架构。换句话说,在64位系统上,您只能构建Wine-x64版本。在Ubuntu 12.04 x64上构建32位的Wine似乎存在错误。因此,只需运行:
./configure --enable-win64

1

不要这样做。即使在64位系统上,Wine默认也会为32位构建(因为它必须运行32位Windows程序)。同时,它还会构建一个64位的Wine。如果您想禁用它,请使用以下配置:

./configure --disable-win64

谢谢您的回答,但还是不起作用。我编辑了我的问题并添加了终端输出。您认为我应该安装哪些库? - m93a
@m93a 你需要为所有Wine依赖项安装32位开发库,例如libalsa、mesa、x11等等。我不知道完整的列表。 - Nikos C.

0

那个链接现在似乎已经失效了。最相关的页面可能是https://wiki.debian.org/Wine。 - mike rodent

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接