Suse11.0 AMD64系统下,安装wine时,如果发生如下的问题:
winegcc: gcc failed
make[2]: *** [winex11.drv.so] Error 2
make[2]: Leaving directory
`/home/manish/Desktop/Download/wine-0.9.49/dlls/winex11.drv'
make[1]: *** [winex11.drv] Error 2
make[1]: Leaving directory
`/home/manish/Desktop/Download/wine-0.9.49/dlls'
make: *** [dlls] Error 2
是因为编译时使用了64位的X libraries,可以参考如下的解决方案:
http://wiki.winehq.org/WineOn64bit
If you just want to use Wine, there is no need to compile it using the instructions here. Just go to the downloads page and click the link for your distribution:
http://www.winehq.org/site/download
Most linux distributions these days support 64-bit. The problem is that not all distributions handle 64-bit in the same way. Distributions like Fedora/Suse chose to extend their 32-bit distribution to 64-bit by installing 64-bit libraries into /usr/lib64 and installing 32-bit libraries in /usr/lib while distributions like Debian chose to install only 64bit libraries. The 64-bit libraries are installed in /usr/lib and /usr/lib64 is a symlink to /usr/lib.
The most common way to do this is to set up a chroot. In order to run 32-bit programs, 32-bit libraries and programs need to be installed in /emul/ia32-linux. The emulation directories then need to be used in combination with chroot. Another alternative is to have the 32 bit libraries installed alongside the 64 bit ones, such as in Ubuntu's /usr/lib32.
In order to run Wine on a distributions like Fedora you can 'just' install Wine and then it should work. 64 bit Ubuntu users can also just install the distro packages, which included the instructions below.
If you want to compile Wine, you can use the instructions below. Debian is more problematic as the wine configure script can't properly detect the 32-bit libraries when installed, and will sometimes point to the 64 bit libraries and throw linking errors, however this can be worked around (see below). If you just want the latest version of Wine in Debian, you should be able to build the etch package in 64 bit as well.
In some 64/32 bit environments the configure script will fail to find some of the 32 bit libraries. If this is caused by pkg-config listing the 64 bit development packages (from /usr/lib64/pkgconfig) you can try to run:
PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig ./configure
You will also want to ensure you do not have spaces in your directory path. For example, /home/user/Source\ Code/wine-0.9.60/ will not work, while /home/user/Source/wine-0.9.60/ will.
Recommended Packages for building Wine on 32bit has its own page
Contents
The build dependencies in the released Wine package should be almost all you need
sudo apt-get build-dep wine
On Debian you may need to add some more, or run the build-dep command after adding the APT Repository .
Wine's configure requires .so links, and for some reason Ubuntu 64 bit doesn't make .so links for the 32 bit libraries. Accordingly, to avoid missing libraries and compile smoothly you'll have to do some linking by hand.
You can make these links in a temporary folder within the wine tree.
mkdir -p `pwd`/lib32 ln -s /usr/lib32/libX11.so.6 `pwd`/lib32/libX11.so ln -s /usr/lib32/libXext.so.6 `pwd`/lib32/libXext.so ln -s /usr/lib32/libfreetype.so.6 `pwd`/lib32/libfreetype.so ln -s /usr/lib32/libfontconfig.so.1 `pwd`/lib32/libfontconfig.so ln -s /usr/lib32/libGL.so.1 `pwd`/lib32/libGL.so ln -s /usr/lib32/libGLU.so.1 `pwd`/lib32/libGLU.so ln -s /usr/lib32/libXrender.so.1 `pwd`/lib32/libXrender.so ln -s /usr/lib32/libXinerama.so.1 `pwd`/lib32/libXinerama.so ln -s /usr/lib32/libXxf86vm.so.1 `pwd`/lib32/libXxf86vm.so ln -s /usr/lib32/libXi.so.6 `pwd`/lib32/libXi.so ln -s /usr/lib32/libXrandr.so.2 `pwd`/lib32/libXrandr.so ln -s /usr/lib32/liblcms.so.1 `pwd`/lib32/liblcms.so ln -s /usr/lib32/libpng12.so.0 `pwd`/lib32/libpng.so ln -s /usr/lib32/libcrypto.so.0.9.8 `pwd`/lib32/libcrypto.so ln -s /usr/lib32/libssl.so.0.9.8 `pwd`/lib32/libssl.so ln -s /usr/lib32/libxml2.so.2 `pwd`/lib32/libxml2.so ln -s /usr/lib32/libjpeg.so.62 `pwd`/lib32/libjpeg.so ln -s /usr/lib32/libXcomposite.so.1 `pwd`/lib32/libXcomposite.so ln -s /usr/lib32/libcups.so.2 `pwd`/lib32/libcups.so ln -s /usr/lib32/libXcursor.so.1 `pwd`/lib32/libXcursor.so ln -s /usr/lib32/libdbus-1.so.3 `pwd`/lib32/libdbus-1.so ln -s /usr/lib32/libhal.so.1 `pwd`/lib32/libhal.so ln -s /usr/lib32/libsane.so.1 `pwd`/lib32/libsane.so ln -s /usr/lib32/libgphoto2.so.2 `pwd`/lib32/libgphoto2.so ln -s /usr/lib32/libgphoto2_port.so.0 `pwd`/lib32/libgphoto2_port.so ln -s /usr/lib32/libldap-2.4.so.2 `pwd`/lib32/libldap.so ln -s /usr/lib32/libldap_r-2.4.so.2 `pwd`/lib32/libldap_r.so ln -s /usr/lib32/liblber-2.4.so.2 `pwd`/lib32/liblber.so ln -s /usr/lib32/libxslt.so.1 `pwd`/lib32/libxslt.so ln -s /usr/lib32/libcapi20.so.3 `pwd`/lib32/libcapi20.so ln -s /usr/lib32/libjack.so.0 `pwd`/lib32/libjack.so ln -s /usr/lib32/libodbc.so.1 `pwd`/lib32/libodbc.so
It is ok if you delete this directory after compiling Wine (configure is linking to the real libs, not the symlinks we just made)
Run configure, build and install with:
CC="gcc-4.2 -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -L`pwd`/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure -v make sudo make install
If all needed libraries are present there will be no missing-library warnings or errors anywhere. If you find that this process misses a library, then it means we are either missing a link or the ia32-libs package is missing the 32 bit version of the library. In either case, contact the Ubuntu package maintainer, Scott Ritchie , so things can be fixed.
We explicitly set CC="gcc-4.2 -m32", although gcc 4.2 is the default now. You can use another to test differences - see our page on GccVersions
If sound doesn't work for you, try using pasuspender and testing your sound with the ALSA driver.
pasuspender winecfg
You can launch applications similarly:
pasuspender wine app.exe
The build dependencies in the released Wine package should be almost all you need
sudo apt-get build-dep wine sudo apt-get install libxcomposite-dev gcc-4.2-multilib
On Debian you may need to add some more, or run the build-dep command after adding the AptRepository .
Wine's configure requires .so links, and for some reason Ubuntu 64 bit doesn't make .so links for the 32 bit libraries. Accordingly, to avoid missing libraries and compile smoothly you'll have to do some linking by hand.
You can make these links in a temporary folder within the wine tree.
mkdir -p `pwd`/lib32 ln -s /usr/lib32/libX11.so.6 `pwd`/lib32/libX11.so ln -s /usr/lib32/libXext.so.6 `pwd`/lib32/libXext.so ln -s /usr/lib32/libfreetype.so.6 `pwd`/lib32/libfreetype.so ln -s /usr/lib32/libfontconfig.so.1 `pwd`/lib32/libfontconfig.so ln -s /usr/lib32/libGL.so.1 `pwd`/lib32/libGL.so ln -s /usr/lib32/libGLU.so.1 `pwd`/lib32/libGLU.so ln -s /usr/lib32/libXrender.so.1 `pwd`/lib32/libXrender.so ln -s /usr/lib32/libXinerama.so.1 `pwd`/lib32/libXinerama.so ln -s /usr/lib32/libXi.so.6 `pwd`/lib32/libXi.so ln -s /usr/lib32/libXrandr.so.2 `pwd`/lib32/libXrandr.so ln -s /usr/lib32/liblcms.so.1 `pwd`/lib32/liblcms.so ln -s /usr/lib32/libcrypto.so.0.9.8 `pwd`/lib32/libcrypto.so ln -s /usr/lib32/libssl.so.0.9.8 `pwd`/lib32/libssl.so ln -s /usr/lib32/libxml2.so.2 `pwd`/lib32/libxml2.so ln -s /usr/lib32/libjpeg.so.62 `pwd`/lib32/libjpeg.so ln -s /usr/lib32/libXcomposite.so.1 `pwd`/lib32/libXcomposite.so ln -s /usr/lib32/libcups.so.2 `pwd`/lib32/libcups.so ln -s /usr/lib32/libXcursor.so.1 `pwd`/lib32/libXcursor.so ln -s /usr/lib32/libsane.so.1 `pwd`/lib32/libsane.so ln -s /usr/lib32/libhal.so.1 `pwd`/lib32/libhal.so ln -s /usr/lib32/libpng12.so.0 `pwd`/lib32/libpng.so ln -s /usr/lib32/libgphoto2.so.2 `pwd`/lib32/libgphoto2.so ln -s /usr/lib32/libgphoto2_port.so.0 `pwd`/lib32/libgphoto2_port.so ln -s /usr/lib32/libldap.so.2 `pwd`/lib32/libldap.so ln -s /usr/lib32/libldap_r.so.2 `pwd`/lib32/libldap_r.so ln -s /usr/lib32/liblber.so.2 `pwd`/lib32/liblber.so ln -s /usr/lib32/libxslt.so.1 `pwd`/lib32/libxslt.so ln -s /usr/lib32/libXxf86vm.so.1 `pwd`/lib32/libXxf86vm.so
It is ok if you delete this directory after compiling Wine (configure is linking to the real libs, not the symlinks we just made)
Run configure, build and install with:
CC="gcc-4.2 -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -L`pwd`/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure make sudo make install
If all needed libraries are present there will be no missing-library warnings or errors anywhere. If you find that this process misses a library, then it means we are either missing a link or the ia32-libs package is missing the 32 bit version of the library.
We explicitly set CC="gcc-4.2 -m32" to work around the problems with the default GCC 4.1. On Feisty, you'll need to use CC="gcc-3.4 -m32" -- see our page on GccVersions
It is strongly recommended you upgrade from Ubuntu 7.04 to 7.10 when building Wine. 7.04 was missing a 32 bit version of libssl, resulting in a Wine without ssl support. Etch is still missing this library.
Bugs (as of 0.9.50): If you make distclean, rerun configure, and check include/configure.h, you can see whether things were successfully linked or not. It appears that I get the following:
/* Define to the soname of the libcapi20 library. */ /* #undef SONAME_LIBCAPI20 */ /* Define to the soname of the libhal library. */ /* #undef SONAME_LIBHAL */ /* Define to the soname of the libjack library. */ /* #undef SONAME_LIBJACK */
Libjack and libcapi20 are missing because 32 bit versions aren't in ia32-libs. libhal is missing because ia32-libs lacks libdbus-1. See launchpad bug 161030 . These are already fixed for Ubuntu Hardy.
cd /usr/lib32 ln -s libdbus-1.so.3 libdbus-1.so
This is required as of 2008/05/20 to prevent Wine warning that HAL cannot be found. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=473586
Download the wine source and assuming gcc and all needed development packages are installed (as per http://wiki.winehq.org/Recommended_Packages ) you can compile wine using (you shouldn't need --prefix=... or --x-libraries=... with the latest Debian Unstable AMD64):
./configure make make installIf the configure command fails with "configure: error: C compiler cannot create executables" and you use gcc-4.1, install "gcc-4.1-multilib" to solve it.
Please read first:
NOTE: This will compile wine and install it into your system. It is a really bad idea to install stuff manually into your gentoo system. If you want to be on the safe side, omit the "make install" command. You can still run wine from the source directory using the wine wrapper found at the root of the directory.
Download the wine source and assuming gcc and all needed development packages are installed you can compile wine using: configure --prefix=/emul/linux/x86/usr --x-libraries=/emul/linux/x86/usr/lib/X11 (in case of xorg 7.0, else */usr/X11R6/lib ), make depend && make, make install
Run wine by executing /emul/linux/usr/bin/wine (you can also make a symlink /usr/bin/wine -> /emul/linux/usr/bin/wine and the same for wineserver, then you can just type wine). If wine complains that it can't find libwine.so.1 make sure /emul/linux/usr/lib is part of the LD_LIBRARY_PATH or run ldconfig -v.
If nothing seems to work try using ebuild to compile it once and copy the source from /var/tmp/portage/wine-9999/work/wine somewhere. Ebuild /usr/portage/app-emulation/wine/wine-9999.ebuild fetch unpack compile. To update CVS add clean to the beginning.
Here is a short version of the script which I use to compile wine checked out from CVS: works with 0.9.24
#!/bin/bash ./configure --x-libraries=/emul/linux/x86/usr/lib/ LDFLAGS="-L/emul/linux/x86/usr/lib -L/emul/linux/x86/lib" make && ./wine --version;
You can use the following to save some space after compilation:
find . -name '*.o' -exec rm \"{}\" \;
or if your find supports:
find . -name '*.o' -delete
I have the following emul packages emerged:
Make sure you have the following 32bit development packages installed in addition to Recommended Packages
For SUSE 11.0 you will need to create these symlinks:
cd /usr/lib sudo ln -s libasound.so.2.0.0 libasound.so sudo ln -s libgphoto2.so.2.3.0 libgphoto2.so sudo ln -s libcups.so.2 libcups.so sudo ln -s libssl.so.0.9.8 libssl.so sudo ln -s libcrypto.so.0.9.8 libcrypto.so sudo ln -s libhal.so.1.0.0 libhal.so sudo ln -s libgphoto2_port.so.0.8.0 libgphoto2_port.so cd /lib sudo ln -s libdbus-1.so.3.4.0 libdbus-1.so sudo ln -s libkeyutils.so.1 /usr/lib/libkeyutils.so
Run configure with:
./configure --prefix=/usr --x-libraries=/usr/X11R6/lib
The --x-libraries switch is important, otherwise it will pick up the 64bit X libraries and just not work.
Run the following commands as root:
cd /usr/lib ln -s libfreetype.so.6 libfreetype.so ln -s libXext.so.6 libXext.so ln -s libX11.so.6 libX11.so ln -s libGLU.so.1 libGLU.so
All the required development packages are available in the core and extras repositories.
Run configure with:
./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include --with-x make depend make
First, remove any wine rpms.
rpm -qa|grep wine|xargs rpm -e
Install these Recommended Packages .
Wine compiles on gcc 4.1.1 but the resulting builds generate an error. This also happens on some other distros. The temporary workarounds involve using -fno-stack-protector or an earlier version of gcc.
export CFLAGS="-fno-stack-protector" ./configure #--prefix=/usr/lib #see note below make depend && make su -c "make install"
Note: This writeup works for nVidia. If you are using older drivers or drivers for other cards you may also have to run as root the first set of commands recommended for Fedora Core 5 and also you may need the same or similar ./configure options as Fedora Core 5 for those drivers.
You may encounter errors with SELinux, but it is recommended that you install setroubleshoot rather than disabling SELinux completely.
First, remove any wine rpms.
rpm -qa|grep wine|xargs rpm -e
Run the following command. This will install all necessary packages.
yum install alsa-lib-devel audiofile-devel esound-devel glib2-devel libogg-devel libvorbis-devel pkgconfig qt-devel fontconfig-devel freetype-devel libICE-devel libSM-devel libX11-devel libXau-devel libXcursor-devel libXdmcp-devel libXext-devel libXft-devel libXinerama-devel libXrandr-devel libXrender-devel libXt-devel libjpeg-devel libmng-devel libpng-devel mesa-libGL-devel xorg-x11-proto-devel libXi-devel sane-backends-devel libieee1284-devel libusb-devel libXmu-devel ncurses-devel gnutls-devel libgcrypt-devel libgpg-error-devel libXv-devel opencdk-devel expat-devel cups-devel e2fsprogs-devel krb5-devel openssl-devel giflib-devel openldap-devel lcms-devel cyrus-sasl-devel libxml-devel libxml2-devel libxslt-devel libxml libXxf86dga-devel libXxf86vm-devel isdn4k-utils-devel libao-devel hal-devel dbus-devel glibc-devel.i386 mesa-libGLU-devel.i386 flex bison fontforge prelink
Now you can build it.
./configure make depend && make make install
First, remove any wine rpms.
rpm -qa|grep wine|xargs rpm -e
Run the following command. This will install all necessary packages.
yum install audiofile-devel esound-devel glib2-devel libogg-devel libvorbis-devel pkgconfig qt-devel freetype-devel libICE-devel libSM-devel libX11-devel libXau-devel libXcursor-devel libXdmcp-devel libXext-devel libXft-devel libXinerama-devel libXrandr-devel libXrender-devel libXt-devel libjpeg-devel libmng-devel libpng-devel mesa-libGL-devel xorg-x11-proto-devel libXi-devel sane-backends-devel libieee1284-devel libusb-devel libXmu-devel ncurses-devel gnutls-devel libgcrypt-devel libgpg-error-devel libXv-devel opencdk-devel expat-devel cups-devel e2fsprogs-devel krb5-devel openssl-devel giflib-devel openldap-devel lcms-devel cyrus-sasl-devel libxml-devel libxml2-devel libxml libXxf86dga-devel libXxf86vm-devel isdn4k-utils-devel libao-devel hal-devel dbus-devel glibc-devel.i386 mesa-libGLU-devel.i386 flex bison fontforge prelink
Now you can build it.
./configure make depend && make make install
Install the following development packages: It is imparitive that the i386 packages are specified as well.
yum install alsa-lib-devel.i386 alsa-lib-devel audiofile-devel.i386 audiofile-devel cups-devel.i386 cups-devel dbus-devel.i386 dbus-devel esound-devel.i386 esound-devel fontconfig-devel.i386 fontconfig-devel freetype-devel.i386 freetype-devel giflib-devel.i386 giflib-devel hal-devel.i386 hal-devel lcms-devel.i386 lcms-devel libICE-devel.i386 libICE-devel libjpeg-devel.i386 libjpeg-devel libpng-devel.i386 libpng-devel libSM-devel.i386 libSM-devel libusb-devel.i386 libusb-devel libX11-devel.i386 libX11-devel libXau-devel.i386 libXau-devel libXcomposite-devel.i386 libXcomposite-devel libXcursor-devel.i386 libXcursor-devel libXext-devel.i386 libXext-devel libXi-devel.i386 libXi-devel libXinerama-devel.i386 libXinerama-devel libxml2-devel.i386 libxml2-devel libXrandr-devel.i386 libXrandr-devel libXrender-devel.i386 libXrender-devel libxslt-devel.i386 libxslt-devel libXt-devel.i386 libXt-devel libXv-devel.i386 libXv-devel libXxf86vm-devel.i386 libXxf86vm-devel mesa-libGL-devel.i386 mesa-libGL-devel mesa-libGLU-devel.i386 mesa-libGLU-devel ncurses-devel.i386 ncurses-devel openldap-devel.i386 openldap-devel openssl-devel.i386 openssl-devel zlib-devel.i386 pkgconfig sane-backends-devel.i386 sane-backends-devel xorg-x11-proto-devel.i386 xorg-x11-proto-devel glibc-devel.i386 prelink fontforge flex bison
Run the configure:
./configure
If you have errors regarding libfreetype, libGL, libGLU, libXext, libX11, libaudiofile not being found, run the appropriate commands:
libfreetype
su - cd /usr/lib ln -s libfreetype.so.6 libfreetype.so
libGL/libGLU
su - cd /usr/lib ln -s libGL.so.1 libGL.so ln -s libGLU.so.1 libGLU.so
libXext
su - cd /usr/lib ln -s libXext.so.6 libXext.so
libX11
su - cd /usr/lib ln -s libX11.so.6 libX11.so
libaudiofile
su - cd /usr/lib ln -s libaudiofile.so.0 libaudiofile.so
If you need ISDN support, run these commands:
yum remove isdn4k-utils-devel isdn4k-utils yum install isdn4k-utils-devel.i386 isdn4k-utils.i386
Now configure should run fine:
ulimit -s unlimited ./configure make depend && make sudo make install
We should probably also have a page called UsingWineOn64bit for users (as opposed to developers).