Compiling SDL_ttf - Unable to find FreeType2 library

I am trying to compile SDL_ttf-2.0.6 with MSYS-1.0.9 running under Win98SE.
I use MSYS to build my development tools. (I use Dev-C+±4.9.8.5 as the IDE
for my own apps.) With MSYS I have built wxWindows and SDL-1.2.6
(successfully, I think). I’m testing my SDL build with some demos which
also require SDL_ttf.

I previously installed the Developer files for FreeType 2.1.5 (I used the
FreeType Setup program), and I find libfreetype.a, libfreetype.dll.a, etc.
in the \GnuWin32\lib directory. I unzipped the SDL_ttf files to
\SDL_ttf-2.0.6, but when I use MSYS to run ./configure from that directory,
I get the error message “Unable to find FreeType2 library.”

I’m guessing that ./configure is looking for the libfreetype* files, but is
unable to find them. Do I need to modify the configure script? Add a flag
to the configure script? How does the configure script know where the
FreeType library is located?

The MSYS output from ./configure is copied below. Any assistance is
appreciated. Thanks.

Glenn-----------------------------------
user at COMPUTER /e/sdl_ttf-2.0.6
$ ./configure

loading cache ./config.cache
checking host system type… i686-pc-mingw32
checking target system type… i686-pc-mingw32
checking for a BSD compatible install… (cached) /bin/install -c
checking whether build environment is sane… yes
checking whether make sets ${MAKE}… (cached) yes
checking for working aclocal… missing
checking for working autoconf… missing
checking for working automake… missing
checking for working autoheader… missing
checking for working makeinfo… found
checking build system type… i686-pc-mingw32
checking for ranlib… (cached) ranlib
checking for gcc… (cached) gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… no
checking whether we are using GNU C… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for ld used by GCC… (cached) e:/mingw/mingw32/bin/ld.exe
checking if the linker (e:/mingw/mingw32/bin/ld.exe) is GNU ld… (cached)
yes
checking for BSD-compatible nm… (cached) /mingw/bin/nm
checking whether ln -s works… (cached) no
checking for dlltool… (cached) dlltool
checking for as… (cached) as
checking for objdump… (cached) objdump
loading cache ./config.cache within ltconfig
checking for object suffix… o
checking for executable suffix… (cached) .exe
checking for gcc option to produce PIC… none
checking if gcc supports -c -o file.o… yes
checking if gcc supports -c -o file.lo… yes
checking if gcc supports -fno-rtti -fno-exceptions … yes
checking if gcc static flag -static works… -static
checking if the linker (e:/mingw/mingw32/bin/ld.exe) is GNU ld… yes
checking whether the linker (e:/mingw/mingw32/bin/ld.exe) supports shared
libraries… yes
checking command to parse /mingw/bin/nm output… ok
checking how to hardcode library paths into programs… immediate
checking for e:/mingw/mingw32/bin/ld.exe option to reload object files… -r
checking dynamic linker characteristics… Win32 ld.exe
checking if libtool supports shared libraries… yes
checking if package supports dlls… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
checking for objdir… .libs
creating libtool
loading cache ./config.cache
checking whether make sets ${MAKE}… (cached) yes
checking for gcc… (cached) gcc
checking whether the C compiler (gcc -g -O2 ) works… yes
checking whether the C compiler (gcc -g -O2 ) is a cross-compiler… no
checking whether we are using GNU C… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for a BSD compatible install… /bin/install -c
checking how to run the C preprocessor… gcc -E
checking for working alloca.h… no
checking for alloca… yes
checking for freetype-config… no
configure: error:
*** Unable to find FreeType2 library (http://www.freetype.org/)


I have about the same configuration on my laptop.
What I did was to reproduce a Unix structure in the MSys environnement.
I remember I installed everything from sources, and I have SDL_ttf.dll,
libSDL_ttf.a and libSDL_ttf.la located in /usr/local/lib - ie in \MSys
\local\lib

Maybe you did about the same thing by using \GnuWin32\lib, but I am not
sure.

You may give ./configure some other paths by defining variables such as
CFLAGS - since ./configure is usually trying to compile a sample
SDL_ttf program to check whether that library is present, you actually
update some variables that ‘make’ passes to gcc, and that ./configure
understands. For example:

CFLAGS="-I/c/GnuWin32/include"
LDFLAGS="-L/c/GnuWin32/lib"
LD_LIBRARY_PATH="/c/GnuWin32/lib"
./configure

(on one single line)

If after some tweaking, that still does not work, the output of 'mount’
may be useful.–
Sylvain

I am trying to compile SDL_ttf-2.0.6 with MSYS-1.0.9 running under
Win98SE.
I use MSYS to build my development tools. (I use Dev-C+±4.9.8.5 as
the IDE
for my own apps.) With MSYS I have built wxWindows and SDL-1.2.6
(successfully, I think). I’m testing my SDL build with some demos
which
also require SDL_ttf.

I previously installed the Developer files for FreeType 2.1.5 (I used
the
FreeType Setup program), and I find libfreetype.a, libfreetype.dll.a,
etc.
in the \GnuWin32\lib directory. I unzipped the SDL_ttf files to
\SDL_ttf-2.0.6, but when I use MSYS to run ./configure from that
directory,
I get the error message “Unable to find FreeType2 library.”

I’m guessing that ./configure is looking for the libfreetype* files,
but is
unable to find them. Do I need to modify the configure script? Add
a
flag
to the configure script? How does the configure script know where
the
FreeType library is located?

The MSYS output from ./configure is copied below. Any assistance is
appreciated. Thanks.

Glenn

user at COMPUTER /e/sdl_ttf-2.0.6
$ ./configure

loading cache ./config.cache
checking host system type… i686-pc-mingw32
checking target system type… i686-pc-mingw32
checking for a BSD compatible install… (cached) /bin/install -c
checking whether build environment is sane… yes
checking whether make sets ${MAKE}… (cached) yes
checking for working aclocal… missing
checking for working autoconf… missing
checking for working automake… missing
checking for working autoheader… missing
checking for working makeinfo… found
checking build system type… i686-pc-mingw32
checking for ranlib… (cached) ranlib
checking for gcc… (cached) gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… no
checking whether we are using GNU C… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for ld used by GCC… (cached) e:/mingw/mingw32/bin/ld.exe
checking if the linker (e:/mingw/mingw32/bin/ld.exe) is GNU ld…
(cached)
yes
checking for BSD-compatible nm… (cached) /mingw/bin/nm
checking whether ln -s works… (cached) no
checking for dlltool… (cached) dlltool
checking for as… (cached) as
checking for objdump… (cached) objdump
loading cache ./config.cache within ltconfig
checking for object suffix… o
checking for executable suffix… (cached) .exe
checking for gcc option to produce PIC… none
checking if gcc supports -c -o file.o… yes
checking if gcc supports -c -o file.lo… yes
checking if gcc supports -fno-rtti -fno-exceptions … yes
checking if gcc static flag -static works… -static
checking if the linker (e:/mingw/mingw32/bin/ld.exe) is GNU ld… yes
checking whether the linker (e:/mingw/mingw32/bin/ld.exe) supports
shared
libraries… yes
checking command to parse /mingw/bin/nm output… ok
checking how to hardcode library paths into programs… immediate
checking for e:/mingw/mingw32/bin/ld.exe option to reload object
files… -r
checking dynamic linker characteristics… Win32 ld.exe
checking if libtool supports shared libraries… yes
checking if package supports dlls… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
checking for objdir… .libs
creating libtool
loading cache ./config.cache
checking whether make sets ${MAKE}… (cached) yes
checking for gcc… (cached) gcc
checking whether the C compiler (gcc -g -O2 ) works… yes
checking whether the C compiler (gcc -g -O2 ) is a cross-compiler…
no
checking whether we are using GNU C… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for a BSD compatible install… /bin/install -c
checking how to run the C preprocessor… gcc -E
checking for working alloca.h… no
checking for alloca… yes
checking for freetype-config… no
configure: error:
*** Unable to find FreeType2 library (http://www.freetype.org/)

Thank you for the reply. After thinking hard about your suggestions, I
decided (because I don’t yet feel confident enough to modify the ./configure
command) to simply compile the FreeType2 source and then recompile SDL_ttf.

Running everything through MSYS, I successfully compiled FreeType2 and
SDL_ttf. Running make install for both packages stored the libraries in the
/usr/local/lib directory. I then add those directories to the compiler
options in Dev-C++. I successfully compiled the sample program which
exercises SDL, SDL_ttf, and FreeType2.

So it appears I have successfully installed Dev-C++, wxWindows, SDL,
SDL_ttf, and FreeType2. I’m pleased. Now comes the really hard part –
writing the apps. I think the lesson here is to rely more on MSYS to
correctly install the development apps…

There were really only three issues:

  1. I had to disable all warnings with the compiler option -w to successfully
    compile the sample program. I would have preferred to enable all warnings
    with -Wall, but the sample program wouldn’t compile otherwise. I think this
    is just a problem with the sample program and not with SDL or FreeType. As
    necessary on a case by case basis, I’ll re-enable compiler warnings.

  2. The FreeType-2.1.5 script file \freetype-2.1.5\builds\win32\detect.mk
    gave a “missing endif” error when I ran ./configure. There seem to be two
    missing endif’s at the end of the file. I added these, and I successfully
    installed FreeType. The detect.mk file I used (with modifications) is
    below.

  3. The detect.mk script did not seem to correctly detect my Win98SE OS. It
    seemed to think I was running a UNIX system. Perhaps, this is because I was
    running it under MSYS. In any case, the FreeType install was successful and
    the sample program compiles correctly. An excerpt from ./configure for the
    FreeType2 install is below.

Thanks again.

Glenn

–Begin excerpt from ./configure for FreeType2 install -----------
configure: creating ./config.status
config.status: creating unix-cc.mk
config.status: creating unix-def.mk
config.status: creating freetype-config
config.status: creating freetype2.pc
config.status: creating ftconfig.h

FreeType build system – automatic system detection

The following settings are used:

platform unix
compiler gcc
configuration directory ./builds/unix
configuration rules ./builds/unix/unix.mk

–End Excerpt from ./configure for FreeType2 install -----------

–Begin detect.mk-----------#

FreeType 2 configuration file to detect a Win32 host platform.

Copyright 1996-2000, 2003 by

David Turner, Robert Wilhelm, and Werner Lemberg.

This file is part of the FreeType project, and may only be used, modified,

and distributed under the terms of the FreeType project license,

LICENSE.TXT. By continuing to use, modify, or distribute this file you

indicate that you have read the license and understand and accept it

fully.

.PHONY: setup

ifeq ($(PLATFORM),ansi)

Detecting Windows NT is easy, as the OS variable must be defined and

contains `Windows_NT’. Untested with Windows 2K, but I guess it should

work…

ifeq ($(OS),Windows_NT)

is_windows := 1

# We test for the COMSPEC environment variable, then run the `ver'
# command-line program to see if its output contains the word `Windows'.
#
# If this is true, we are running a win32 platform (or an emulation).
#

else
ifdef COMSPEC
is_windows := $(findstring Windows,$(strip $(shell ver)))
endif
endif # test NT

ifdef is_windows

PLATFORM := win32

endif
endif # test PLATFORM ansi

ifeq ($(PLATFORM),win32)

DELETE := del
COPY := copy
SEP := $(BACKSLASH)

gcc Makefile by default

CONFIG_FILE := w32-gcc.mk
ifeq ($(firstword $(CC)),cc)
CC := gcc
endif

ifneq ($(findstring list,$(MAKECMDGOALS)),) # test for the “list” target
dump_target_list:
@echo

endif ## XNH20031228 Added to close if structure
endif ## XNH20031228 Added to close if structure
—End detect.mk-----------------

----- Original Message -----

Message: 13
Date: Sun, 28 Dec 2003 13:26:43 +0100
From: Sylvain Beucler
To: sdl at libsdl.org
Subject: Re: [SDL] Compiling SDL_ttf - Unable to find FreeType2 library
Reply-To: sdl at libsdl.org

I have about the same configuration on my laptop.
What I did was to reproduce a Unix structure in the MSys environnement.
I remember I installed everything from sources, and I have SDL_ttf.dll,
libSDL_ttf.a and libSDL_ttf.la located in /usr/local/lib - ie in \MSys
\local\lib

Maybe you did about the same thing by using \GnuWin32\lib, but I am not
sure.

You may give ./configure some other paths by defining variables such as
CFLAGS - since ./configure is usually trying to compile a sample
SDL_ttf program to check whether that library is present, you actually
update some variables that ‘make’ passes to gcc, and that ./configure
understands. For example:

CFLAGS="-I/c/GnuWin32/include"
LDFLAGS="-L/c/GnuWin32/lib"
LD_LIBRARY_PATH="/c/GnuWin32/lib"
./configure

(on one single line)

If after some tweaking, that still does not work, the output of 'mount’
may be useful.


Sylvain

I am trying to compile SDL_ttf-2.0.6 with MSYS-1.0.9 running under
Win98SE.
I use MSYS to build my development tools. (I use Dev-C+±4.9.8.5 as
the IDE
for my own apps.) With MSYS I have built wxWindows and SDL-1.2.6
(successfully, I think). I’m testing my SDL build with some demos
which
also require SDL_ttf.

I previously installed the Developer files for FreeType 2.1.5 (I used
the
FreeType Setup program), and I find libfreetype.a, libfreetype.dll.a,
etc.
in the \GnuWin32\lib directory. I unzipped the SDL_ttf files to
\SDL_ttf-2.0.6, but when I use MSYS to run ./configure from that
directory,
I get the error message “Unable to find FreeType2 library.”

I’m guessing that ./configure is looking for the libfreetype* files,
but is
unable to find them. Do I need to modify the configure script? Add
a
flag
to the configure script? How does the configure script know where
the
FreeType library is located?

The MSYS output from ./configure is copied below. Any assistance is
appreciated. Thanks.

Glenn

user at COMPUTER /e/sdl_ttf-2.0.6
$ ./configure

loading cache ./config.cache
[snip]

checking for freetype-config… no
configure: error:
*** Unable to find FreeType2 library (http://www.freetype.org/)

Hello again,

  1. I could compile ‘showfont’ without warning, but maybe you are
    mentioning another sample program;
  2. I also have freetype-2.1.5 and I could run ./configure without
    problem the first time. That is strange;
  3. Actually Cygwin (and so MSys) is a Unix environnement on top on
    Windows. However, I think recent ./configure generated with the GNU
    autotools now have special rules for MSys.

I may make a clean install again and see if I get those problems.–
Sylvain

Thank you for the reply. After thinking hard about your suggestions,
I
decided (because I don’t yet feel confident enough to modify the
./configure
command) to simply compile the FreeType2 source and then recompile
SDL_ttf.

Running everything through MSYS, I successfully compiled FreeType2
and
SDL_ttf. Running make install for both packages stored the libraries
in the
/usr/local/lib directory. I then add those directories to the
compiler
options in Dev-C++. I successfully compiled the sample program which
exercises SDL, SDL_ttf, and FreeType2.

So it appears I have successfully installed Dev-C++, wxWindows, SDL,
SDL_ttf, and FreeType2. I’m pleased. Now comes the really hard part

writing the apps. I think the lesson here is to rely more on MSYS to
correctly install the development apps…

There were really only three issues:

  1. I had to disable all warnings with the compiler option -w to
    successfully
    compile the sample program. I would have preferred to enable all
    warnings
    with -Wall, but the sample program wouldn’t compile otherwise. I
    think this
    is just a problem with the sample program and not with SDL or
    FreeType. As
    necessary on a case by case basis, I’ll re-enable compiler warnings.

  2. The FreeType-2.1.5 script file \freetype-2.1.5\builds\win32
    \detect.mk
    gave a “missing endif” error when I ran ./configure. There seem to
    be
    two
    missing endif’s at the end of the file. I added these, and I
    successfully
    installed FreeType. The detect.mk file I used (with modifications)
    is
    below.

  3. The detect.mk script did not seem to correctly detect my Win98SE
    OS. It
    seemed to think I was running a UNIX system. Perhaps, this is
    because
    I was
    running it under MSYS. In any case, the FreeType install was
    successful and
    the sample program compiles correctly. An excerpt from ./configure
    for the
    FreeType2 install is below.

Thanks again.

Glenn

–Begin excerpt from ./configure for FreeType2 install -----------
configure: creating ./config.status
config.status: creating unix-cc.mk
config.status: creating unix-def.mk
config.status: creating freetype-config
config.status: creating freetype2.pc
config.status: creating ftconfig.h

FreeType build system – automatic system detection

The following settings are used:

platform unix
compiler gcc
configuration directory ./builds/unix
configuration rules ./builds/unix/unix.mk

–End Excerpt from ./configure for FreeType2 install -----------

–Begin detect.mk-----------

FreeType 2 configuration file to detect a Win32 host platform.

Copyright 1996-2000, 2003 by

David Turner, Robert Wilhelm, and Werner Lemberg.

This file is part of the FreeType project, and may only be used,

modified,

and distributed under the terms of the FreeType project license,

LICENSE.TXT. By continuing to use, modify, or distribute this file

you

indicate that you have read the license and understand and accept

it

fully.

.PHONY: setup

ifeq ($(PLATFORM),ansi)

Detecting Windows NT is easy, as the OS variable must be defined

and

contains `Windows_NT’. Untested with Windows 2K, but I guess it

should

work…

ifeq ($(OS),Windows_NT)

is_windows := 1

# We test for the COMSPEC environment variable, then run the  

ver' # command-line program to see if its output contains the wordWindows’.
#
# If this is true, we are running a win32 platform (or an
emulation).
#
else
ifdef COMSPEC
is_windows := $(findstring Windows,$(strip $(shell ver)))
endif
endif # test NT

ifdef is_windows

PLATFORM := win32

endif
endif # test PLATFORM ansi

ifeq ($(PLATFORM),win32)

DELETE := del
COPY := copy
SEP := $(BACKSLASH)

gcc Makefile by default

CONFIG_FILE := w32-gcc.mk
ifeq ($(firstword $(CC)),cc)
CC := gcc
endif

ifneq ($(findstring list,$(MAKECMDGOALS)),) # test for the "list"
target
dump_target_list:
@echo

endif ## XNH20031228 Added to close if structure
endif ## XNH20031228 Added to close if structure
—End detect.mk-----------------

The sample program I ran was not ‘showfont,’ but, rather was taken from Ron
Penton’s book, 'Data Structures for Game Programmers."

Also, don’t risk fouling up your system on my account. I’m happy to share
my experience, but even happier to have a system which appears to be running
properly.

Thanks again.

Glenn> Date: Mon, 29 Dec 2003 11:22:08 +0100

From: Sylvain Beucler
To: sdl at libsdl.org
Subject: Re: [SDL] Compiling SDL_ttf - Unable to find FreeType2 library
Reply-To: sdl at libsdl.org

Hello again,

  1. I could compile ‘showfont’ without warning, but maybe you are
    mentioning another sample program;
  2. I also have freetype-2.1.5 and I could run ./configure without
    problem the first time. That is strange;
  3. Actually Cygwin (and so MSys) is a Unix environnement on top on
    Windows. However, I think recent ./configure generated with the GNU
    autotools now have special rules for MSys.

I may make a clean install again and see if I get those problems.


Sylvain

Thank you for the reply. After thinking hard about your suggestions,
I
decided (because I don’t yet feel confident enough to modify the
./configure
command) to simply compile the FreeType2 source and then recompile
SDL_ttf.

Running everything through MSYS, I successfully compiled FreeType2
and
SDL_ttf. Running make install for both packages stored the libraries
in the
/usr/local/lib directory. I then add those directories to the
compiler
options in Dev-C++. I successfully compiled the sample program which
exercises SDL, SDL_ttf, and FreeType2.

So it appears I have successfully installed Dev-C++, wxWindows, SDL,
SDL_ttf, and FreeType2. I’m pleased. Now comes the really hard part

writing the apps. I think the lesson here is to rely more on MSYS to
correctly install the development apps…

There were really only three issues:

  1. I had to disable all warnings with the compiler option -w to
    successfully
    compile the sample program. I would have preferred to enable all
    warnings
    with -Wall, but the sample program wouldn’t compile otherwise. I
    think this
    is just a problem with the sample program and not with SDL or
    FreeType. As
    necessary on a case by case basis, I’ll re-enable compiler warnings.

  2. The FreeType-2.1.5 script file \freetype-2.1.5\builds\win32
    \detect.mk
    gave a “missing endif” error when I ran ./configure. There seem to
    be
    two
    missing endif’s at the end of the file. I added these, and I
    successfully
    installed FreeType. The detect.mk file I used (with modifications)
    is
    below.

  3. The detect.mk script did not seem to correctly detect my Win98SE
    OS. It
    seemed to think I was running a UNIX system. Perhaps, this is
    because
    I was
    running it under MSYS. In any case, the FreeType install was
    successful and
    the sample program compiles correctly. An excerpt from ./configure
    for the
    FreeType2 install is below.

Thanks again.

Glenn

–Begin excerpt from ./configure for FreeType2 install -----------
configure: creating ./config.status
config.status: creating unix-cc.mk
config.status: creating unix-def.mk
config.status: creating freetype-config
config.status: creating freetype2.pc
config.status: creating ftconfig.h

FreeType build system – automatic system detection

The following settings are used:

platform unix
compiler gcc
configuration directory ./builds/unix
configuration rules ./builds/unix/unix.mk

–End Excerpt from ./configure for FreeType2 install -----------

–Begin detect.mk-----------

FreeType 2 configuration file to detect a Win32 host platform.

Copyright 1996-2000, 2003 by

David Turner, Robert Wilhelm, and Werner Lemberg.

This file is part of the FreeType project, and may only be used,

modified,

and distributed under the terms of the FreeType project license,

LICENSE.TXT. By continuing to use, modify, or distribute this file

you

indicate that you have read the license and understand and accept

it

fully.

.PHONY: setup

ifeq ($(PLATFORM),ansi)

Detecting Windows NT is easy, as the OS variable must be defined

and

contains `Windows_NT’. Untested with Windows 2K, but I guess it

should

work…

ifeq ($(OS),Windows_NT)

is_windows := 1

# We test for the COMSPEC environment variable, then run the

ver' # command-line program to see if its output contains the wordWindows’.
#
# If this is true, we are running a win32 platform (or an
emulation).
#
else
ifdef COMSPEC
is_windows := $(findstring Windows,$(strip $(shell ver)))
endif
endif # test NT

ifdef is_windows

PLATFORM := win32

endif
endif # test PLATFORM ansi

ifeq ($(PLATFORM),win32)

DELETE := del
COPY := copy
SEP := $(BACKSLASH)

gcc Makefile by default

CONFIG_FILE := w32-gcc.mk
ifeq ($(firstword $(CC)),cc)
CC := gcc
endif

ifneq ($(findstring list,$(MAKECMDGOALS)),) # test for the "list"
target
dump_target_list:
@echo

endif ## XNH20031228 Added to close if structure
endif ## XNH20031228 Added to close if structure
—End detect.mk-----------------