9

I am using Ubuntu 11.10 64bit and trying to install wine 1.5, using this method:

Install Wine on Ubuntu:

sudo apt-get install libfreetype6-dev gobject* libxrender-dev libfontconfig-dev pthread* libpthread-stubs0-dev xext* libsm-dev

and copy the following commands in the Terminal:

wget http://prdownloads.sourceforge.net/wine/wine-1.5.0.tar.bz2
tar -xjvf wine-1.5.0.tar.bz2
cd wine-1.5.0

Install some packages:

sudo apt-get install flex bison qt3-dev-tools qt4-qmake
./configure
cd tools
./wineinstall

All goes well, but at the end, I get this error message:

checking for -lfreetype... not found
configure: error: FreeType 32-bit development files not found. Fonts will not be built. 
Use the --without-freetype option if you really want this.

Does anyone know how to install lfreetype?

10 Answers 10

7

It complains about missing the 32bit dev package of freetype.
You can try installing it with sudo apt-get install libfreetype6-dev:i386 and see if the warning has gone.

4
  • Thanks, but I have 64bit and I have installed: sudo apt-get install libfreetype6-dev .... I am wondering if wine 1.5 is only available in i386... However did add 64bit version, still same issue.. sudo apt-get install libfreetype6-dev
    – pst007x
    Mar 25, 2012 at 11:00
  • 8
    Please read which packages will be removed from your system before attempting the above command Users have reported the removal of system-critical packages.
    – earthmeLon
    May 21, 2012 at 4:41
  • Not a good idea. The following packages will be REMOVED: cpp g++ g++-multilib gcc gcc-multilib ...
    – kenorb
    Jun 14, 2015 at 12:18
7

Get to the directory that you've extracted the files for wine.

In terminal, run this command:

./configure --without-freetype

Then after it's completely done, run:

make
2
  • 1
    Could you add what're the downsides? I.e. how often freetype is used, what would happen if an app needs this freetype? Or at least anything of this?
    – Hi-Angel
    Sep 7, 2015 at 12:07
  • I tried installation using --without-freetype option wine installed successfully but when I opened wine application it showing too small tiny rectangle window :( look like missing something
    – ni3
    Oct 4, 2018 at 17:45
3

Revert the following patch from your source tree and compile again:

From a37f74f5adec8cd3f924fc96e083a66219086091 Mon Sep 17 00:00:00 2001
From: Nicolas Le Cam <[email protected]>
Date: Sat, 7 Apr 2012 22:46:58 +0200
Subject: [PATCH] configure.ac: Prefer pkg-config over freetype-config.

---
 configure    | 16 +++++++++++-----
 configure.ac | 14 ++++++++++----
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 3e6e777..5b0dcba 100755
--- a/configure
+++ b/configure
@@ -10262,7 +10262,12 @@ fi

 if test "x$with_freetype" != "xno"
 then
-    for ac_prog in freetype-config freetype2-config
+    if test "$PKG_CONFIG" != "false"
+    then
+        ac_freetype_incl="`$PKG_CONFIG --cflags freetype2 2>/dev/null`"
+        ac_freetype_libs="`$PKG_CONFIG --libs freetype2 2>/dev/null`"
+    else
+        for ac_prog in freetype-config freetype2-config
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -10305,10 +10310,11 @@ fi
 done
 test -n "$ft_devel" || ft_devel="no"

-    if test "$ft_devel" != "no"
-    then
-        ac_freetype_incl=`$ft_devel --cflags`
-        ac_freetype_libs=`$ft_devel --libs`
+        if test "$ft_devel" != "no"
+        then
+            ac_freetype_incl=`$ft_devel --cflags`
+            ac_freetype_libs=`$ft_devel --libs`
+        fi
     fi
     ac_freetype_libs=${ac_freetype_libs:-"-lfreetype"}
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lfreetype" >&5
diff --git a/configure.ac b/configure.ac
index 667d725..a57f133 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1384,11 +1384,17 @@ WINE_NOTICE_WITH(cms,[test "$ac_cv_lib_lcms_cmsOpenProfileFromFile" != "yes"],
 dnl **** Check for FreeType 2 ****
 if test "x$with_freetype" != "xno"
 then
-    AC_CHECK_PROGS(ft_devel,[freetype-config freetype2-config],no)
-    if test "$ft_devel" != "no"
+    if test "$PKG_CONFIG" != "false"
     then
-        ac_freetype_incl=`$ft_devel --cflags`
-        ac_freetype_libs=`$ft_devel --libs`
+        ac_freetype_incl="`$PKG_CONFIG --cflags freetype2 2>/dev/null`"
+        ac_freetype_libs="`$PKG_CONFIG --libs freetype2 2>/dev/null`"
+    else
+        AC_CHECK_PROGS(ft_devel,[freetype-config freetype2-config],no)
+        if test "$ft_devel" != "no"
+        then
+            ac_freetype_incl=`$ft_devel --cflags`
+            ac_freetype_libs=`$ft_devel --libs`
+        fi
     fi
     ac_freetype_libs=${ac_freetype_libs:-"-lfreetype"}
     WINE_CHECK_SONAME(freetype,FT_Init_FreeType,[ft_lib=yes],[ft_lib=no],[$ac_freetype_libs])
-- 
2.1.4
3

To configure wine on 64-bit machine, you should do:

./configure --enable-win64

If you really want to compile 32-bit wine on 64-bit machine, then I think the easiest way is to use the lxc container as Ubuntu 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).

So the basic approach to compile both 32-bit and 64-bit wine is:

  1. Build 64-bit wine
  2. Build 32-bit tools in lxc
  3. Build 32-bit wine in lxc, referring to the 64-bit wine and 32-bit tools 1. built in the previous steps
  4. Install 32-bit wine
  5. Install 64-bit wine

On the page Building Biarch (Shared WoW64) Wine On Ubuntu we can read the following instructions:

  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.

Note: 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.

1

Just install the default libfreetype6-dev, and libfreetype6:i386, next make a link for the library.

sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib/i386-linux-gnu/libfreetype.so

For unknown reason in one of my PCs I had a problem when the configure told an error in libfreetype6, but it actually was libz and libpng. Either way, you can solve the problem the same way

sudo apt-get install libpng12-0-dev libpng12-0:i386 zlib1g-dev zlib1g:i386
sudo ln -s /usr/lib/i386-linux-gnu/libpng12.so.0 /usr/lib/i386-linux-gnu/libpng12.so
sudo ln -s /usr/lib/i386-linux-gnu/libz.so.1.2.8 /usr/lib/i386-linux-gnu/libz.so

A general way to solve alike problems: open the config.log file, goto the end, and search in the upper direction a word error. You will find a code that have been used to test a presence of a library or headers. Just copy the main function with includes into a separate file; next seek above the code the command that was used to compile. It would look something like

gcc -m32 -o conftest -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0   conftest.c  >&5

Remove the >&5 part, write instead of conftest.c name of your test file (to which you just copied the code), and try to compile with this command — you will see a much more useful error messages. That is basically the minimal test case, and once it is solved, the problem solved too.

Tips for possible errors:

  • Missing headers — just go to packages.ubuntu.com, and search for the header name to find a package you're missing
  • Missing libraries — install the library with -dev postfix, then if it didn't work, with :i386. If it didn't work again like in the case of the libfreetype, then go with the solution that written above — i.e. make symbolic links by hand.
1

Linux

The problem is that Ubuntu pkg-config doesn't see your FreeType 32-bit development files.

  • To verify that this is the case, you can check it by the following command:

      pkg-config --cflags --libs freetype2
    

    You should have the error, that pkg-config can't find this package.

    Note: If you don't have pkg-config, please install it via sudo apt-get install pkg-config

  • Then, please verify if your freetype was installed correctly and where.

      $ dpkg -l | grep freetype        
      $ sudo updatedb && locate freetype2
    
  • Try to reinstall it, just in case:

      sudo apt-get update && sudo apt-get install libfreetype6-dev --reinstall
    
  • If still doesn't work, please find your pc file in your freetype package:

      dpkg -L libfreetype6 libfreetype6-dev | grep pc$
    

    or anywhere else:

      sudo updatedb && locate freetype2.pc
    

    and make sure that this file is linked up inside your pkgconfig directory (locate pkgconfig):

      ln -s YOUR_FOUND_PATH/freetype2.pc /usr/lib/x86_64-linux-gnu/pkgconfig/freetype2.pc
    

    Note: Replace YOUR_FOUND_PATH with your full path of freetype2.pc file.


* If you can't find your pc file, please create one inside your pkc_config dir (as freetype2.pc):
    prefix=/usr
    exec_prefix=${prefix}
    libdir=${prefix}/lib/x86_64-linux-gnu
    includedir=${prefix}/include

    Name: FreeType 2
    Description: A free, high-quality, and portable font engine.
    Version: 14.0.8
    Requires:
    Libs: -L${libdir} -lfreetype
    Libs.private: -lz  
    Cflags: -I${includedir}/freetype2 -I${includedir}
  • If your problem is still not solved (or it's related to something else), please debug your ./configure script in shell:

      $ sh -x ./configure
    

And find the place of your problem (e.g. which pkg-config command is executed to verify existence of the specific package).

Mac

If you have similar problem on Mac and you found this topic, please use homebrew to install your freetype package:

sudo brew install freetype

If you still have the problem, check this bug.

0

well instead you sudo what you what it's better you just go to Ubuntu software center and get what you want, comes all in one so you don't have to sudo them all just click one thing and everything come in a package, ready to be use...

0
PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig ./configure

Try configure with that line. It might be your trying to compile on 64 bit system a 32 bit wine and you will find that configure sometimes checks in wrong place for the libs.

1
  • No, that changes nothing.
    – Hi-Angel
    Sep 7, 2015 at 12:11
0

I installed freetype from source http://sourceforge.net/projects/freetype/files/ with

./configure --without-png 
make 
sudo make install
-1
ln -s /usr/include/freetype2/freetype /usr/include
1
  • 1
    After flags (like -s), the ln command takes its first argument as the target of the link, and the second argument (if present) as the source. The command you've posted will try to create /usr/include as a symbolic link to /usr/include/freetype2/freetype, which will invariably fail since any Ubuntu system already has a real /usr/include directory. Did you mean it the other way around? Jun 21, 2012 at 10:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .