C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 16th, 2013, 02:02 PM
Bloehdian Bloehdian is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 Bloehdian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 51 sec
Reputation 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

Reply With Quote
  #2  
Old January 16th, 2013, 02:49 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,383 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 13 h 44 m 42 sec
Reputation Power: 383
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!

Reply With Quote
  #3  
Old January 17th, 2013, 08:01 AM
Bloehdian Bloehdian is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 Bloehdian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 51 sec
Reputation Power: 0
Hi,

Quote:
breaking my cairo installation


I do not think that this is strictly necessary.

I guess that a "little" bit help with includes might be sufficient already.

Reply With Quote
  #4  
Old January 17th, 2013, 08:19 AM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,383 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 13 h 44 m 42 sec
Reputation Power: 383
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

Reply With Quote
  #5  
Old January 17th, 2013, 10:32 AM
Bloehdian Bloehdian is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 Bloehdian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 51 sec
Reputation 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?

Reply With Quote
  #6  
Old January 17th, 2013, 10:58 AM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,383 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 13 h 44 m 42 sec
Reputation Power: 383
I haven't had to use exceed for many years.
Perhaps cygwin/X11 would better fit your situation?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Problem with inclusions when installing cairo

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap