Compiling Error

Hi,

I have installed "Freetype2" library in my SuSe Linux 9.3 version system. When Iam compiling a program, I am getting these below errors.

Undefined reference to "FT_Init_FreeType"
Undefined reference to "FT_Load_Char"

Please show me a solution? Thank you.

With regards,
Chandramouli

That's not a compiler error, that's a linker error. Compilation is when it turns your source code into machine code and symbol names, in other words, .o files. Linking is when it tries to find symbols, either in your own code or a library, then bind the code to them. Symbols are functions or variables.

Libraries don't get searched for symbols unless you tell the linker to use them. You'll need to use the "-lfreetype" flag when linking the executable, which will tell it to search for those missing functions inside libfreetype.so .