5

When compiling pango I get this error:

lib/libfreetype.so: undefined reference to `hb_ft_font_create'

I've compiled freetype and harfbuzz; also I pass -lfreetype and -lharfbuzz in LIBS variable.

m.s.
  • 16,063
  • 7
  • 53
  • 88
nitin kumar
  • 642
  • 12
  • 21
  • 2
    Check order of libraries: -lfreetype -lharfbuzz or -lharfbuzz -lfreetype? It does matter. – gomons Apr 20 '15 at 14:54
  • Tried both of them. None worked. – nitin kumar Apr 21 '15 at 05:54
  • The order of other libraries used matter too. Look here: http://www.linuxtopia.org/online_books/an_introduction_to_gcc/gccintro_18.html. Try to find out, where symbol `hb_ft_font_create` defined in library you are using. – gomons Apr 21 '15 at 10:42
  • It's cyclical: https://stackoverflow.com/questions/49896474/how-to-compile-freetype-2-and-harfbuzz-with-visual-studio-to-make-them-work plus comments – rogerdpack Jan 30 '19 at 07:03

3 Answers3

1

Im guessing you're using Freetype as part of some other library, in which case you may not need harfbuzz, which seems to be there for some kind of smoothing on the fonts.

If this is the case, at the top of cmakelists.txt for FreeType just add set (CMAKE_DISABLE_FIND_PACKAGE_HarfBuzz TRUE) its not required to build freetype

Mich
  • 3,188
  • 4
  • 37
  • 85
0

Look for the definition and declaration of the function 'hb_ft_font_create'. remove any 'extern', 'inline' or any additional keywords before the return type. something like this:

FUNC_DEF extern blah blah blah hb_face_t* hb_ft_face_create()

to

hb_face_t* hb_ft_face_create()

in both declaration and definition; hope it helps.

Omid
  • 199
  • 1
  • 7
-1

i came across the same problem,and solved by following: RE ./configure the harfbuzz and install...