'MAKE fails to find ft2build.h (freetype2 header) -freetype(2.8.1) is installed properly

I am Trying to compile 'xplanet' R224 (latest version) on Ubuntu 18.04 MAKE fails to find ft2build.h (freetype2 header) I have 'freetype'(2.8.1) installed properly and all the files are there. I have searched stackoverflow and found many people with the same problem (ft2build.h not found) yet no consensus on why or what the solution is.

Any help is appreciated.

MAKE ERROR MESSAGE:
In file included from getTextRenderer.cpp:8:0:
TextRendererFT2.h:4:10: fatal error: ft2build.h: No such file or directory
#include <ft2build.h>
compilation terminated.
Makefile:458: recipe for target 'getTextRenderer.o' failed
make[3]: *** [getTextRenderer.o] Error 1


MY INSTALLED FREETYPE FILES:
ls /usr/include/freetype2/freetype/config
ftconfig.h ftheader.h ftmodule.h ftoption.h ftstdlib.h

ls /usr/include/freetype2/freetype
config ftautoh.h ftbzip2.h ftcid.h ftgasp.h ftimage.h ftlzw.h ftmoderr.h ftpfr.h ftstroke.h ftttdrv.h ttnameid.h
freetype.h ftbbox.h ftcache.h fterrdef.h ftglyph.h ftincrem.h ftmac.h ftotval.h ftrender.h ftsynth.h fttypes.h tttables.h
ft2build.h ftbdf.h ftcffdrv.h fterrors.h ftgxval.h ftlcdfil.h ftmm.h ftoutln.h ftsizes.h ftsystem.h ftwinfnt.h tttags.h
ftadvanc.h ftbitmap.h ftchapters.h ftfntfmt.h ftgzip.h ftlist.h ftmodapi.h ftpcfdrv.h ftsnames.h fttrigon.h t1tables.h ttunpat.h

ls /usr/include/freetype2
freetype ft2build.h


MAKEFILE INCLUDES THESE LINES:
FREETYPE2_CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16 
FREETYPE2_LIBS = -lfreetype
FREETYPE_CFLAGS =  
FREETYPE_LIBS =  


Solution 1:[1]

The solution above was completely successful. FREETYPE2 was misspelled in three places as FREETYPE in "src/Makefile.am" Installation had no further problems

Molly Feb 27 at 22:50

Solution 2:[2]

They have there a mix of FREETYPE and FREETYPE2 variables for some reason. I managed to make it compile with those changes:

In src/libdisplay/Makefile.am:

--- src/libdisplay/Makefile.am.old      2022-02-27 22:21:56.089575296 +0100
+++ src/libdisplay/Makefile.am  2022-02-27 22:22:13.424197851 +0100
@@ -26,7 +26,7 @@

 EXTRA_libdisplay_a_SOURCES = DisplayMacAqua.cpp DisplayMacAqua.h DisplayMSWin.cpp DisplayMSWin.h TextRendererFT2.cpp TextRendererFT2.h TextRendererPangoFT2.cpp TextRendererPangoFT2.h DisplayX11.cpp DisplayX11.h vroot.h TimerMacAqua.cpp TimerMacAqua.h TimerX11.cpp TimerX11.h

-AM_CPPFLAGS = -I@top_srcdir@/src @X_CFLAGS@ @FREETYPE_CFLAGS@
+AM_CPPFLAGS = -I@top_srcdir@/src @X_CFLAGS@ @FREETYPE2_CFLAGS@

 if USE_AR
   libdisplay_a_AR = $(AR) cru

In src/Makefile.am:

--- src/Makefile.am.old 2022-02-27 22:22:02.953029931 +0100
+++ src/Makefile.am     2022-02-27 22:22:31.438766211 +0100
@@ -8,7 +8,7 @@
   parsegeom = ParseGeom.c ParseGeom.h
 endif

-AM_CPPFLAGS = -DDATADIR=\"$(datadir)@separator@xplanet\" @X_CFLAGS@ @FREETYPE_CFLAGS@
+AM_CPPFLAGS = -DDATADIR=\"$(datadir)@separator@xplanet\" @X_CFLAGS@ @FREETYPE2_CFLAGS@
 AM_LDFLAGS = @xplanet_LDFLAGS@

 xplanet_SOURCES = \
@@ -72,5 +72,5 @@
                libprojection/libprojection.a           \
                libsgp4sdp4/libsgp4sdp4.a               \
                @GRAPHICS_LIBS@ @CSPICE_LIBS@ @X_LIBS@  \
-               @XSS_LIBS@ @FREETYPE_LIBS@ @AQUA_LIBS@  \
+               @XSS_LIBS@ @FREETYPE2_LIBS@ @AQUA_LIBS@         \
                @LIBICONV@ @LIBCHARSET@

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Molly
Solution 2 danadam