Hello folks,
I am trying to install the cairo graphics library on Linux in a non-standard location and get into troubles with inclusions:
I am trying to link the necessary dependencies using the following assignments:
Code:
export CFLAGS="-I$PRJ/gtk+/freetype/include -I$PRJ/gtk+/freetype/include/freetype2 -I$PRJ/gtk+/fontconfig/include"
export LDFLAGS="-L$PRJ/gtk+/freetype/lib -I$PRJ/gtk+/fontconfig/lib"
(with $PRJ being my project's directory)
The directory $PRJ/gtk+/freetype/include contains the file ft2build.h.
The directory $PRJ/gtk+/freetype/include/freetype2 contains the path pointing to the file ftheader.h (freetype/config/ftheader.h) and the path to the file ftlcdfil.h (freetype/ftlcdfil.h).
Configure runs fine with this configuration.
But when it comes to make, I get the following error messages:
Code:
make all-recursive
make[1]: Entering directory `/path_to_project_dir/cpn/gtk+/cairo-1.12.8'
Making all in src
make[2]: Entering directory `/path_to_project_dir/cpn/gtk+/cairo-1.12.8/src'
make all-am
make[3]: Entering directory `/path_to_project_dir/cpn/gtk+/cairo-1.12.8/src'
CC cairo-ft-font.lo
cairo-ft-font.c:64:10: error: #include expects "FILENAME" or <FILENAME>
cairo-ft-font.c: In function '_render_glyph_outline':
cairo-ft-font.c:1377: error: implicit declaration of function 'FT_Library_SetLcdFilter'
cairo-ft-font.c:1377: warning: nested extern declaration of 'FT_Library_SetLcdFilter'
make[3]: *** [cairo-ft-font.lo] Error 1
make[3]: Leaving directory `/path_to_project_dir/cpn/gtk+/cairo-1.12.8/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/path_to_project_dir/cpn/gtk+/cairo-1.12.8/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/path_to_project_dir/cpn/gtk+/cairo-1.12.8'
make: *** [all] Error 2
The context of line 64 in cairo-ft-font.c looks as follows:
Code:
53 #include <ft2build.h>
54 #include FT_FREETYPE_H
55 #include FT_OUTLINE_H
56 #include FT_IMAGE_H
57 #include FT_TRUETYPE_TABLES_H
58 #include FT_XFREE86_H
59 #if HAVE_FT_GLYPHSLOT_EMBOLDEN
60 #include FT_SYNTHESIS_H
61 #endif
62
63 #if HAVE_FT_LIBRARY_SETLCDFILTER
64 #include FT_LCD_FILTER_H
65 #endif
ft2build.h from the freetype library is obviously included in cairo-ft-font.c.
The relevant lines in this file read as follows:
Code:
31 #ifndef __FT2_BUILD_GENERIC_H__
32 #define __FT2_BUILD_GENERIC_H__
33
34 #include <freetype/config/ftheader.h>
35
36 #endif /* __FT2_BUILD_GENERIC_H__ */
So, ftheader.h, should be included in cairo-ft-font.c as well (indirectly).
In that file we find:
Code:
697 /*************************************************************************
698 *
699 * @macro:
700 * FT_LCD_FILTER_H
701 *
702 * @description:
703 * A macro used in #include statements to name the file containing the
704 * FreeType~2 API which performs color filtering for subpixel rendering.
705 */
706 #define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
ftlcdfil.h finally contains the following:
Code:
160 FT_EXPORT( FT_Error )
161 FT_Library_SetLcdFilter( FT_Library library,
162 FT_LcdFilter filter );
My understanding is the following:
The first error message make throws means that FT_LCD_FILTER_H is not defined in cairo-ft-font.c, therefore the declaration of FT_Library_SetLcdFilter (residing in ftlcdfil.h) cannot be loaded. As a consequence, make throws the second error message.
But, from my point of view, the compiler SHOULD find the function's declaration since all necessary includes are present as demonstrated (when I insert line 706 (#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>) from file ftheader.h immediately before the current line 64 of cairo-ft-font.c make works!).
What could be the problem?
Cheers
Bloehdian