Build libfreetype with custom, embedded environment fails

Erich Ente <[email protected]> Wed, 25 Mar 2026 07:27:55 +0100
Newsgroups gmane.comp.fonts.freetype.user
Message-ID <CAPykt4bZ4FonCHHUDrRjrqk-uP=G_xxuwDwRV-fMWae9W1cEzg@mail.gmail.com>
Hi everybody,

I'm trying to build the original and official libfreetype for a embedded
platform (to be more accurate: a bare-metal application which is built with
the CodeComposerStudio by Texas Instruments). As libfreetype is ANSI-C
based, this should be no problem (unfortunately it is).

All the predefined build-struff like the cmake and other scripts/Makefiles
can not be used as they do not fit to the CCS environment, so I tried to
set it up from scratch. What I have done so far:

   -

   copied the freetype-2.10.0 folder into my working directory
   -

   in src/ I have removed all subdirectories except base, psnames, sfnt,
   truetype in order to get a minimalistic library which supports TTF only
   -

   the include/ directory was left untouched
   -

   in my project settings I have added a include-path which points to
   include/
   -

   in my project settings I have added a definition FT2_BUILD_LIBRARY in
   order to let it build a linkable library

Unfortunately something seems to be missing as I have a lot of undefined
stuff here:

   -

   FT_ERR_PREFIX is undefined in fterrors.c
   -

   FT_Error_String( FT_Error error_code ) in fterrors.h causes an error
   -

   FT_EXPORT in fterrors.h is undefined
   -

   the whole FT_NOERRORDEF_ stuff in fterrdef.h is undefined
   -

   when I ensure FT_ERR_PREFIX being defined for FT_NOERRORDEF_, it
   complains about all the errorcodes (such as Cannot_Open_Resource) not being
   defined in fterrdef.h

So it seems, something important is missing. Any hints/ideas what is wrong
here?

Thanks!

PS: this is the output of the compiler:

>> Compilation failure

base/subdir_rules.mk:7: recipe for target 'base/fterrors.obj' failed
"/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/freetype/fterrdef.h",
line 60: error #68: expected a "}"
"/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/freetype/fterrors.h",
line 204: warning #12-D: parsing restarts here after previous syntax
error
"/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/freetype/fterrdef.h",
line 60: warning #1916-D: definition at end of file not followed by a
semicolon or a declarator
"/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/freetype/fterrors.h",
line 274: error #142-D: unnamed prototyped parameters not allowed when
body is present
"/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/freetype/fterrors.h",
line 275: error #131: expected a "{"
"../base/fterrors.c", line 27: warning #12-D: parsing restarts here
after previous syntax error
"../base/fterrors.c", line 28: error #20: identifier "error_code" is undefined
"../base/fterrors.c", line 29: error #110: expression preceding
parentheses of apparent call must have (pointer-to-) function type
"../base/fterrors.c", line 29: error #20: identifier "FT_Err_" is undefined
"../base/fterrors.c", line 29: error #20: identifier "Max" is undefined
"../base/fterrors.c", line 30: error #20: identifier "NULL" is undefined
8 errors detected in the compilation of "../base/fterrors.c".
gmake: *** [base/fterrors.obj] Error 1
Building file: "../base/ftdbgmem.c"