0

I include freetype and header, not I can find functions, but in building say me: error: undefined reference to FT_Init_FreeType I read something, but my folder don't have lib file to add in pro file. I download libary here, version 2.6. How can I fix dat problem?

#include <freetype-2.6/include/ft2build.h>
#include FT_FREETYPE_H
....
FT_Library ft;
if(FT_Init_FreeType(&ft)) {
  std::cout << "ERROR::FREETYPE: Could not init FreeType Library" << std::endl;
}
Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
Nejc Galof
  • 2,538
  • 3
  • 31
  • 70
  • Does it work without Qt? – dtech Jan 09 '16 at 13:17
  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Alan Stokes Jan 09 '16 at 13:24

1 Answers1

2

The error you get is a linker error because you don't link against the freetype library.

To get the lib files, you either have to download the binaries from the freetype website (last available version is 2.35), or you compile the library yourself from the source version you already downloaded (use cmake for this). Instructions on how to compile can be found in the README and in docs/INSTALL.

BDL
  • 21,052
  • 22
  • 49
  • 55