无法在 64 位 linux 上构建 32 位 Wine
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13780319/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't build 32bit Wine on 64bit linux
提问by m93a
I'm trying to do this:
Build 32bit on 64 bit Linux using an automake configure script?
Doesn't work for me :(
Compileing wine. I found this in config.log:
我正在尝试这样做:
使用 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 "[email protected]"
| #define PACKAGE_URL "http://www.winehq.org"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
Configuration fails with: Cannot build a 32-bit program, you need to install 32-bit development libraries.
配置失败: Cannot build a 32-bit program, you need to install 32-bit development libraries.
回答by Nikos C.
Don't do that. Wine builds for 32-bit by default even on 64-bit systems (since it has to run 32-bit Windows programs.) It also builds a 64-bit Wine at the same time. If you want to disable that, configure it with:
不要那样做。Wine 默认为 32 位构建,即使在 64 位系统上也是如此(因为它必须运行 32 位 Windows 程序。)同时它还构建一个 64 位 Wine。如果要禁用它,请使用以下命令进行配置:
./configure --disable-win64
回答by jaap
The Wine wiki has an easy way to install the needed 32bit development libraries on a 64bit system, using chroot: http://wiki.winehq.org/WineOn64bit
Wine wiki 有一种简单的方法可以使用 chroot 在 64 位系统上安装所需的 32 位开发库:http: //wiki.winehq.org/WineOn64bit
回答by JDong
What worked to some extent for me on Debian Wheezy:
在 Debian Wheezy 上什么对我有用:
dpkg --add-architecture i386
apt-get update
to enable installation from the i386 repos
启用从 i386 存储库安装
apt-get install ia32-libs libc6-dev-i386 lib32z1-dev lib32bz2-dev
to install the 32 bit libs. I'm actually still having trouble with X libs:
安装 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.
but it's technically optional.
但它在技术上是可选的。
回答by vell001
you may solve the X error:
你可以解决 X 错误:
sudo apt-get install xorg-dev
回答by anonymous
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
and
和
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
got me past X error.
让我过去了 X 错误。
回答by Methew
I guess you use Ubuntu x64 which now supports multi-architecture. In other words on a 64 bit system you can build only Wine-x64 version. Building 32bit Wine on Ubuntu 12.04 x64 seems to buggy as for now.
我猜您使用的是现在支持多架构的 Ubuntu x64。换句话说,在 64 位系统上,您只能构建 Wine-x64 版本。就目前而言,在 Ubuntu 12.04 x64 上构建 32 位 Wine 似乎有问题。
So just run:
所以只需运行:
./configure --enable-win64
回答by kenorb
To build 32-bit wine on 64-bit machine, you can use LXC (Linux Containers) which is an operating-system-level virtualization environment for running multiple isolated Linux systems. It's the easiest solution so far, as Linux (such as Ubuntu or Debian) makes building 32-bit wine hard because the 64-bit system doesn't come with a full set of 32-bit development libraries (See: Bug #990982).
要在 64 位机器上构建 32 位 wine,您可以使用 LXC(Linux Containers),它是一个操作系统级虚拟化环境,用于运行多个隔离的 Linux 系统。这是迄今为止最简单的解决方案,因为 Linux(例如 Ubuntu 或 Debian)使得构建 32 位 wine 变得困难,因为 64 位系统没有配备全套 32 位开发库(参见:Bug #990982) .
So the basic approach to compile both 32-bit and 64-bit wine is:
所以编译 32 位和 64 位 wine 的基本方法是:
- Build 64-bit wine
- Build 32-bit tools in lxc
- Build 32-bit wine in lxc, referring to the 64-bit wine and 32-bit tools 1. built in the previous steps
- Install 32-bit wine
- Install 64-bit wine
- 构建 64 位 Wine
- 在 lxc 中构建 32 位工具
- 在lxc中构建32位wine,参考前面步骤中构建的64位wine和32位工具1.
- 安装 32 位 wine
- 安装 64 位 wine
On the page Building Biarch (Shared WoW64) Wine On Ubuntuwe can read the following instructions:
在Building Biarch (Shared WoW64) Wine On Ubuntu 页面上,我们可以阅读以下说明:
Install the 64-bit prerequisites:
sudo apt-get update sudo apt-get build-dep wine
Build 64-bit wine:
mkdir $HOME/wine64 cd $HOME/wine64 ../wine-git/configure --enable-win64 make -j4
Install lxc:
sudo apt-get install lxc
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
Copy the apt configuration from the host to the lxc container:
sudo cp -R /etc/apt /var/lib/lxc/my32bitbox/rootfs/etc
Start the container; at the console login prompt it gives you, log in with your username and password.
sudo lxc-start -n my32bitbox
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
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
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
Still inside the container, install the 32-bit wine to force the last little bit of building:
cd $HOME/wine32 sudo make install
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.
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.
- Next, install Mono, Gecko, and optionally winetricks if you had to remove their packages because of a dependency on a conflicting wine package.
安装 64 位先决条件:
sudo apt-get update sudo apt-get build-dep wine
构建 64 位 wine:
mkdir $HOME/wine64 cd $HOME/wine64 ../wine-git/configure --enable-win64 make -j4
安装 lxc:
sudo apt-get install lxc
使用 Ubuntu 模板创建一个名为“my32bitbox”的 32 位容器,并将您的主目录绑定到容器中的 /home 目录:
sudo lxc-create -t ubuntu -n my32bitbox -- --bindhome $LOGNAME -a i386
将 apt 配置从主机复制到 lxc 容器:
sudo cp -R /etc/apt /var/lib/lxc/my32bitbox/rootfs/etc
启动容器;在控制台登录提示时,它给你,用你的用户名和密码登录。
sudo lxc-start -n my32bitbox
现在您在容器内,在您真正的主目录中。如果您不在容器中(您没有提示 username@my32bitbox),则打开一个新终端并:
sudo lxc-attach -n my32bitbox login yourusername+password
现在,您在容器中。像往常一样对 Wine 进行树外构建,只是为了获取工具。您必须先安装所有必需的先决条件。例如:
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
仍然在容器内,再做一次,这次指向数据的 64 位构建,以及工具的 32 位工具构建:
mkdir $HOME/wine32 cd $HOME/wine32 ~/wine-git/configure --with-wine64=$HOME/wine64 --with-wine-tools=$HOME/wine32-tools make -j4
仍然在容器内,安装 32 位 wine 以强制构建最后一点:
cd $HOME/wine32 sudo make install
仍在容器内时,将其关闭:
sudo shutdown -h now
这会让您回到真正的机器上。接下来,您需要删除所有现有的 Wine 包。您可以从命令行执行此操作,但使用 aptitude 或其中一种 GUI 包管理工具可能更容易。您将需要wine-mono、wine-gecko 和可选的winetricks 来编译您的wine 版本。但是,这些软件包可能依赖于现有的 wine 安装,这可能会迫使您删除它们。
将新建的 wine 安装到你的真机中:
cd $HOME/wine32 sudo make install cd $HOME/wine64 sudo make install
警告:当您安装本地构建的 Wine 版本时,包管理系统不会知道它存在,因为它不是来自包。因此,以后可以在没有包管理工具警告的情况下打破其依赖关系或安装有冲突的 wine 版本。您可以通过创建包或通过为包设置“Pin-Priority:-1”来阻止冲突包与 apt-pinning 来防止这种情况。
- 接下来,如果由于依赖冲突的 wine 包而不得不删除它们的包,请安装 Mono、Gecko 和可选的 winetricks。
Notes:
笔记:
- Many of the above commands require root privileges. Your user account needs to have access to root via
sudo
or you need to switch to a user account. - It's not necessary to remove your distro version and 'install' your compiled versions (32bit, 64bit) You simply need to invoke your personal version of wine appropriate for the Windows app. For example:
~/wine32/wine32 ~/.wine/path_to_winapp/my_app
.
- 上述许多命令都需要 root 权限。您的用户帐户需要通过 root 访问,
sudo
或者您需要切换到用户帐户。 - 没有必要删除您的发行版并“安装”您的编译版本(32 位、64 位)您只需要调用适用于 Windows 应用程序的个人版本的 wine。例如:
~/wine32/wine32 ~/.wine/path_to_winapp/my_app
。