#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Problem with inclusions when installing cairo


    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
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,851
    Rep Power
    481
    Sorry man, I don't feel like breaking my cairo installation to try to duplicate your difficulties.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0
    Hi,

    breaking my cairo installation
    I do not think that this is strictly necessary. :rolleyes:

    I guess that a "little" bit help with includes might be sufficient already. ;)
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,851
    Rep Power
    481
    Try this site. http://lists.cairographics.org/archives/cairo/2010-December/021311.html

    The #1 problem!

    I copied this into google:

    install the cairo graphics library on Linux in a non-standard location

    Comments on this post

    • salem agrees : Nice detective work
    [code]Code tags[/code] are essential for python code and Makefiles!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0
    Hi,

    the hint using the pc-file to link to freetype given in the document solved the problem finally. Thanks a lot.

    After linking to Glib properly as well, make did its job.

    make install worked fine as well (apart from one error which was marked as 'ignored'), so, in principle, I could try to use the library.

    But, make check threw many FAILs, until (after an awful lot of tests) the X-server (Exceed) crashed.

    Do You have any experience with the installation of cairo from the scratch? Any advice how to cope with the FAILs?
  10. #6
  11. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,851
    Rep Power
    481
    I haven't had to use exceed for many years.
    Perhaps cygwin/X11 would better fit your situation?
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo