freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] failed to compile ftvalid.c


From: mpsuzuki
Subject: Re: [ft-devel] failed to compile ftvalid.c
Date: Thu, 17 Nov 2005 15:47:38 +0900

Hi,

On Thu, 17 Nov 2005 11:46:09 +0900
address@hidden wrote:

>>ft2demos/obj/ftvalid.o: In function `run_ot_validator':
>>ft2demos/src/ftvalid.c:447: undefined reference to `FT_Free_Debug'
>>ft2demos/obj/ftvalid.o: In function `run_gx_validator':
>>ft2demos/src/ftvalid.c:498: undefined reference to `FT_Free_Debug'
>>ft2demos/obj/ftvalid.o: In function `run_ckern_validator':
>>ft2demos/src/ftvalid.c:566: undefined reference to `FT_Free_Debug'

Excuse me, you received this error in compiling ftvalid.c
into ftvalid.o? Or, you received it in linking ftvalid.o
to ftvalid executable?

If it's in compiling, I don't know why it's complained,
because the compiler should know that FT_Free_Debug is
declared as external symbol, by including
freetype2/include/freetype/internal/ftmemory.h.

If it's in linking, it's a bit complexed problem. GNU ld
with --retain-symbols-file removes unlisted symbols from
.symtab, but don't remove them from .dynsym. As a result,
I cannot find FT_Free_Debug in
        "nm -a freetype2/objs/.libs/libfreetype.so",
but I can find it in
        "nm -D freetype2/objs/.libs/libfreetype.so".

When I link ftvalid.o refering FT_Free_Debug(),
with libfreetype.so that does not have FT_Free_Debug() in its
.symtab, GNU ld detects that FT_Free_Debug() exists in
libfreetype.so, and linking is finished successfully.
When I add "-Wl,--trace-symbol=FT_Free_Debug", I receive
following output. GNU ld detects FT_Free_Debug() in
libfreetype.so.

$ gcc -Wl,--trace-symbol=FT_Free_Debug -Wall -ansi -pedantic \
  -DFT_DEBUG_LEVEL_ERROR -DFT_DEBUG_LEVEL_TRACE -DFT_DEBUG_MEMORY \
  -o ./bin/.libs/ftvalid \
     ./obj/ftvalid.o ./obj/common.o \
     ../freetype2/objs/.libs/libfreetype.so \
     -lz 

./obj/ftvalid.o: reference to FT_Free_Debug
../freetype2/objs/.libs/libfreetype.so: definition of FT_Free_Debug

I guess this is the known behaviour of GNU ld, See:
        http://sourceware.org/ml/binutils/2001-12/msg00143.html

How did you remove FT_Free_Debug() completely?


Regards,
mpsuzuki


P.S.
BTW, now I think about this issue: the tools outside of libfreetype
should not refer FT_Alloc_Debug(), FT_Free_Debug() etc etc anymore.
Therefore, ftvalid.c should include ftdbgmem.c by itself?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]