Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41467 - kde-base/kdegraphics-3.2.0 build fails on Glyph.cpp
Summary: kde-base/kdegraphics-3.2.0 build fails on Glyph.cpp
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: foser (RETIRED)
: 44856 (view as bug list)
Depends on:
Reported: 2004-02-13 08:03 UTC by dallas.morlock
Modified: 2006-06-20 05:34 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description dallas.morlock 2004-02-13 08:03:14 UTC
/bin/sh ../../../../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../../../../.. -I/usr/include -I/usr/include/freetype2 -I/usr/kde/3.2/include -I/usr/qt/3/include -I/usr/X11R6/include   -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -DNDEBUG -DNO_DEBUG -O2 -march=i686 -O2 -pipe -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -fexceptions -c -o Glyph.lo `test -f 'Glyph.cpp' || echo './'`Glyph.cpp
In file included from Font.cpp:25:
Font.h:74: syntax error before `&'
Font.h:79: syntax error before `;'
In file included from Converter.h:29,
                 from Font.cpp:27:
/usr/include/freetype2/freetype/ftoutln.h:101: `FT_Error' was not declared in this scope
/usr/include/freetype2/freetype/ftoutln.h:102: syntax error before `('
/usr/include/freetype2/freetype/ftoutln.h:136: `FT_Error' was not declared in this scope
/usr/include/freetype2/freetype/ftoutln.h:137: redefinition of `int FT_EXPORT'
/usr/include/freetype2/freetype/ftoutln.h:102: `int FT_EXPORT' previously defined here
/usr/include/freetype2/freetype/ftoutln.h:137: syntax error before `('
/usr/include/freetype2/freetype/ftoutln.h:143: `FT_Error' was not declared in this scope
/usr/include/freetype2/freetype/ftoutln.h:144: redefinition of `int FT_EXPORT'
/usr/include/freetype2/freetype/ftoutln.h:137: `int FT_EXPORT' previously defined here
/usr/include/freetype2/freetype/ftoutln.h:144: syntax error before `('
/usr/include/freetype2/freetype/ftoutln.h:174: `FT_Error' was not declared in this scope
/usr/include/freetype2/freetype/ftoutln.h:175: redefinition of `int FT_EXPORT'
/usr/include/freetype2/freetype/ftoutln.h:144: `int FT_EXPORT' previously defined here
/usr/include/freetype2/freetype/ftoutln.h:175: syntax error before `('
/usr/include/freetype2/freetype/ftoutln.h:179: `FT_Error' was not declared in this scope
/usr/include/freetype2/freetype/ftoutln.h:180: redefinition of `int FT_EXPORT'
/usr/include/freetype2/freetype/ftoutln.h:175: `int FT_EXPORT' previously defined here
/usr/include/freetype2/freetype/ftoutln.h:180: syntax error before `('
/usr/include/freetype2/freetype/ftoutln.h:198: `FT_Error' was not declared in this scope
/usr/include/freetype2/freetype/ftoutln.h:199: redefinition of `int FT_EXPORT'
/usr/include/freetype2/freetype/ftoutln.h:180: `int FT_EXPORT' previously defined here
/usr/include/freetype2/freetype/ftoutln.h:199: syntax error before `('
/usr/include/freetype2/freetype/ftoutln.h: In function `int FT_EXPORT()':
/usr/include/freetype2/freetype/ftoutln.h:226: `int FT_EXPORT()' redeclared as different kind of symbol
/usr/include/freetype2/freetype/ftoutln.h:199: previous declaration of `int FT_EXPORT'
/usr/include/freetype2/freetype/ftoutln.h:199: previous non-function declaration `int FT_EXPORT'
/usr/include/freetype2/freetype/ftoutln.h:226: conflicts with function declaration `int FT_EXPORT()'
/usr/include/freetype2/freetype/ftoutln.h:226: parse error before `('
/usr/include/freetype2/freetype/ftoutln.h:226: `FT_Outline' undeclared (first use this function)
/usr/include/freetype2/freetype/ftoutln.h:226: (Each undeclared identifier is reported only once
/usr/include/freetype2/freetype/ftoutln.h:226: for each function it appears in.)
/usr/include/freetype2/freetype/ftoutln.h:226: `outline' undeclared (first use this function)
/usr/include/freetype2/freetype/ftoutln.h:227: `FT_BBox' undeclared (first use this function)
/usr/include/freetype2/freetype/ftoutln.h:227: `acbox' undeclared (first use this function)
/usr/include/freetype2/freetype/ftoutln.h:227: confused by earlier errors, bailing out
cpp0: output pipe has been closed
make[6]: *** [Font.lo] Error 1
make[6]: *** Waiting for unfinished jobs....
In file included from Glyph.cpp:22:
Glyph.h:53: syntax error before `*'
Glyph.h:57: syntax error before `['
Glyph.cpp:62: syntax error before `*'
make[6]: *** [Glyph.lo] Error 1
make[6]: Leaving directory `/var/tmp/portage/kdegraphics-3.2.0/work/kdegraphics-3.2.0/ksvg/impl/libs/libtext2path/src'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/var/tmp/portage/kdegraphics-3.2.0/work/kdegraphics-3.2.0/ksvg/impl/libs/libtext2path'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/var/tmp/portage/kdegraphics-3.2.0/work/kdegraphics-3.2.0/ksvg/impl/libs'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/kdegraphics-3.2.0/work/kdegraphics-3.2.0/ksvg/impl'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/kdegraphics-3.2.0/work/kdegraphics-3.2.0/ksvg'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/kdegraphics-3.2.0/work/kdegraphics-3.2.0'
make: *** [all] Error 2

!!! ERROR: kde-base/kdegraphics-3.2.0 failed.
!!! Function kde_src_compile, Line 127, Exitcode 2
!!! died running emake, kde_src_compile:make

Reproducible: Always
Steps to Reproduce:
1. emerge -u kde

Portage 2.0.50-r1 (default-1.0, gcc-2.95.3, glibc-2.2.5-r2,2.2.5-r9, 2.4.23)
System uname: 2.4.23 i686 Pentium III (Coppermine)
Gentoo Base System version
Autoconf: sys-devel/autoconf-2.58
Automake: sys-devel/automake-1.7.7
CFLAGS="-march=i686 -O2 -pipe"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=i686 -O2 -pipe"
FEATURES="autoaddcvs ccache sandbox"
USE="3dnow X aalib alsa apm arts avi berkdb cdr crypt cups encode esd gdbm gif
gnome-libs gpm gtk guile imlib java jpeg kde libg++ libwww mikmod mmx motif
mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png postgres
python qt quicktime readline scanner sdl slang spell ssl svga tcltk tcpd tetex
tiff truetype x86 xml2 xmms xv"
Comment 1 Richard Taylor 2004-02-14 04:21:55 UTC
I am getting the same problem. I tried to re-emerge freetype but that did not fix it.
Comment 2 Richard Taylor 2004-02-14 06:48:48 UTC
I am not sure what the root cause is but, it looks like there are two freetype.h files on my system. One in /usr/include/freetype and the other in /usr/include/freetype2/freetype. Because the include path to the compile have /usr/include before /usr/include/freetype2 the first version of freetype.h is used. This version is the wrong one.

I moved /usr/include/freetype to /usr/include/freetype.old so that the freetype.h in there would not be used. This has worked for me but it does really answer the real cause of the problem.
Comment 3 Håkon A. Hjortland 2004-02-14 16:53:47 UTC
Same problem here.

# qpkg -f -v /usr/include/freetype2/freetype/freetype.h
media-libs/freetype-2.1.4 *
# qpkg -f -v /usr/include/freetype/freetype.h
media-libs/freetype-1.3.1-r3 *
Comment 4 Håkon A. Hjortland 2004-02-18 14:41:54 UTC
Crazy fix that simply reorders the include paths in all files.
Add this to kdegraphics-3.2.0.ebuild:
src_unpack() {
  unpack "$A"
  cd "$S"
  # Bug 41467
  echo "Fixing Freetype include dir presedence problem"
  find . -name | while read f; do
    sed 's/INCLUDES *= *\(.*\) \($(LIBFREETYPE_CFLAGS)\)/INCLUDES = \2 \1/' "$f" |
    sed 's/INCLUDES *= *\(.*\) \($(FREETYPE_CFLAGS)\)/INCLUDES = \2 \1/' > "$f.fixed"
    mv -f "$f.fixed" "$f"

No guarantees, here.
It did, however, make kdegraphics-3.2.0 compile on my system.
Comment 5 Caleb Tennis (RETIRED) gentoo-dev 2004-02-19 11:08:45 UTC
Any reason you have freetype1 around?  I thought freetype2 was a replacement for it.
Comment 6 jake 2004-02-19 11:17:01 UTC
I took Richard Taylor's advice and moved /usr/include/freetype to /usr/include/freetype.old

So is perhaps the real problem that when installing freetype2, it does not un-install freetype1?  Perhaps we dont actually want to do this either.  In that case, how do we maintain freetype1 and 2 together?
Comment 7 Håkon A. Hjortland 2004-02-19 13:14:00 UTC
# grep -H freetype-1 /var/db/pkg/*/*/DEPEND
/var/db/pkg/x11-wm/enlightenment-0.16.6/DEPEND: =media-libs/freetype-1*

        esd? ( >=media-sound/esound-0.2.19 )
Comment 8 Stewart (RETIRED) gentoo-dev 2004-04-05 00:10:27 UTC
Unmerging freetype 1.3.1-r3 seems to have done the trick. I believe it's stagnant anyways; I'll double-check if anything is dependant on it shortly. It would, however, be nice to get this l'il buglet squashed before dozens of users run screaming to RPMs. :P
Comment 9 Dominik Stadler (RETIRED) gentoo-dev 2004-04-05 08:04:21 UTC
*** Bug 44856 has been marked as a duplicate of this bug. ***
Comment 10 Caleb Tennis (RETIRED) gentoo-dev 2004-04-26 18:53:24 UTC
Since it's a freetype thing, I'll let the maintainer decide what to do :)
Comment 11 foser (RETIRED) gentoo-dev 2004-05-05 07:46:34 UTC
includes look fine to me, it also works fine here. I noticed both users seemed to be on gcc2 . Bit of a long shot, but might that be the cause ? Nobody on gcc3 experiencing it ?

As for a solution, this really should go ok judging from the source & g++ lines. A somewhat dirty workaround would probably be to just force the inclusion of the freetype2 dir before anything else (define it in C(XX)FLAGS might work). Basicly what was suggested in comment #4 .

Reassigning : kde team should fix this.
Comment 12 Caleb Tennis (RETIRED) gentoo-dev 2004-05-05 07:53:47 UTC
It works fine here (gcc 3).  The problem seems to be local and it seems to be more related to having multiple instances of freetype installed.
Comment 13 foser (RETIRED) gentoo-dev 2004-05-05 08:03:17 UTC
i got that, but the way of inclusion is meant to solve this problem (check out how it includes freetype stuff). So that's why i think the gcc behaviour here is (/was) incorrect.

Having both freetype1 & 2 installed should be no problem.
Comment 14 Håkon A. Hjortland 2004-05-10 16:11:44 UTC
I think it looks like freetype was not very well designed for cohabitation between version 1 and 2. But then, I'm no libraries expert.
Look at this:

# grep INCLUDES kdegraphics-3.2.0/ksvg/impl/libs/libtext2path/src/
# fribidi-config --cflags
# freetype-config --cflags
# ll /usr/include/freetype2/freetype/freetype.h /usr/include/freetype/freetype.h
-rw-r--r--    1 root     root          44K Mar 22 07:25 /usr/include/freetype/freetype.h
-rw-r--r--    1 root     root         189K Mar 19 10:40 /usr/include/freetype2/freetype/freetype.h

So, the fribidi-thing will add /usr/include to the inclusion path before freetype gets to add /usr/include/freetype2. Since there is a "freetype/freetype.h" in both of these directories, the first one will be used, which, according to my comment #3 belongs to freetype 1, and not version 2.
Comment 15 foser (RETIRED) gentoo-dev 2004-05-11 03:39:06 UTC
were it not that freetype/freetype.h never gets included directly here afaics. In theory it should go ok, so i still think it's a gcc2 thing messing with includes.

That's why i suggest the simple solution to just switch the includes around for now.
Comment 16 Håkon A. Hjortland 2004-05-13 12:05:57 UTC
I think the "switching includes around" idea is good.
I do still, however, think that something is wrong with freetype 1/2.

Let's look at the file Glyph.h in the directory where compilation fails:

> cd kdegraphics-3.2.0/ksvg/impl/libs/libtext2path/src
> grep -i '#include.*ft' Glyph.h
#include <ft2build.h>
#include FT_FREETYPE_H

OK, so let's try to find out where FT_FREETYPE_H is defined:

> grep '^#include' /usr/include/ft2build.h
#include <freetype/config/ftheader.h>
> grep 'define.*FT_FREETYPE_H' /usr/include/freetype2/freetype/config/ftheader.h
#define FT_FREETYPE_H  <freetype/freetype.h>

So, freetype/freetype.h _does_ get included, as far as I can see.
Comment 17 foser (RETIRED) gentoo-dev 2004-05-20 17:09:08 UTC
right, keen eye there. But still it seems to be a gcc2 only include re-ordering issue. I don't see the harm in reordering in an ebuild as a fix for now. These problems used to be fairly common time ago when freetype2 was younger, but i haven't seen one in a long while.

The whole new freetype include setup seems to be focused at moving towards a better header files seperation to avoid just these problems, so future versions should eventually fix it.

We might consider doing some similar preliminary work ourselves (shouldn't be too hard if we complete the move to >=ft-2.17).
Comment 18 Gregorio Guidi (RETIRED) gentoo-dev 2005-02-02 03:32:50 UTC
Reassigning, nothing KDE can do for this bug.
Comment 19 Jakub Moc (RETIRED) gentoo-dev 2006-06-05 05:22:40 UTC
How about WONTFIX? Could really care less about gcc-2.95, you can't even install it on Gentoo any more without a major hassle. 
Comment 20 foser (RETIRED) gentoo-dev 2006-06-20 05:34:29 UTC
no problem with that