Search code examples
c++eclipse-cdtfreetypeharfbuzz

undefined reference to `hb_ft_font_create' on Windows, Cygwin


I've got the following error when I tried to compile my program using Cygwin and Eclipse CDT on Windows.

undefined reference to `hb_ft_font_create'

I think this is caused by the order of -l parameter. Basically this function depends on Freetype2, but the autohinter of Freetype2 also depends on Harfbuzz. That makes it a cyclic dependencies problem.

If I reverse the order between -lharfbuzz and -lfreetype, the other set of errors containing undefined reference to other bunch of harfbuzz functions (not includeing hb_ft_font_create) shows up.

So how could I resolve the undefined reference problem ?


Solution

  • It says HarfBuzz is not compiled with FreeType support. You should've compiled HarfBuzz first without FreeType support then after compiling FreeType with HarfBuzz support, compile HarfBuzz with FreeType support (or the reverse way, first compiling FreeType without HarfBuzz and then the rest)