Include ft2build.h in project on Linux

May 2024 ยท 1 minute read

I've been trying to compile a JUCE project on Linux debian but a line is giving me an error:

#include <ft2build.h> 

And stops compilation. How do I link to this file?

1 Answer

So I've had this issue before and found the straight answer this time.

First, check if you have libfreetype installed. I used:

pkg-config --cflags freetype2 

I do have the library installed, so I got this as a result:

-I/usr/include/freetype2 -I/usr/include/libpng16 

If you don't have it installed, do:

sudo apt-get install libfreetype-dev libfreetype6 libfreetype6-dev 

And try the first command again.

Then, link the header in your compilation. Using the ProJucer, this is easy, just paste /usr/include/freetype2 in the Header Search Paths in the settings section.

1

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobW1oZW5%2BdnyOoqWcpKWZsm6y02uZrqGcmXqpecinZKmqn5%2BypMCMqKVmpJmjwrk%3D