FreeType2 compile-time errors. [solved]
Posted: Sun Jul 05, 2009 6:30 am
I recently restarted a project I put on hold for about a year and I'm having problems compiling part of the code that uses the FreeType2 library posted here. The code compiled flawlessly with a previous version of the SDK (about a year old...), but I get a linking error with a recent update (26/06/09) of the SDK. Unfortunately I did not keep a copy of the older SDK.
I recompiled the FreeType2 library against the newer SDK without any problems, but the problem still persists. It seems that using the FT_Init_FreeType( ... ) function causes the error that I can't seem to fix.
For simplicity, this code reproduces the same error. FT_New_Face( ... ) is included to show that the rest of the program compiles "fine" but the FT_Init_FreeType( ... ) causes an error, and is hopefully the only one that does so. Could anyone with the FreeType2 library test this out for me and see if it compiles?
Makefile:
Error:
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1cid.o)(.text+0x12d4):src/cid/cidload.c:332: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1cid.o)(.text+0x12d8):src/cid/cidload.c:332: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1.o)(.text+0x7d8):src/type1/t1afm.c:115: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1.o)(.text+0x2c10):src/type1/t1afm.c:66: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1.o)(.text+0x7dc):src/type1/t1afm.c:115: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1.o)(.text+0x828):src/type1/t1afm.c:124: more undefined references to `_ctype_' follow
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type42.o)(.text+0x2078):src/type42/t42drivr.c:96: undefined reference to `atoi'
collect2: ld returned 1 exit status
make: *** [freetype.elf] Error 1
Additional info:
OS: Debian GNU/Linux squeeze/sid
libfreetype is installed under:
/usr/local/ps2dev/ps2sdk/ports/include/freetype/
/usr/local/ps2dev/ps2sdk/ports/include/ft2build.h
/usr/local/ps2dev/ps2sdk/ports/libfreetype.a
I recompiled the FreeType2 library against the newer SDK without any problems, but the problem still persists. It seems that using the FT_Init_FreeType( ... ) function causes the error that I can't seem to fix.
For simplicity, this code reproduces the same error. FT_New_Face( ... ) is included to show that the rest of the program compiles "fine" but the FT_Init_FreeType( ... ) causes an error, and is hopefully the only one that does so. Could anyone with the FreeType2 library test this out for me and see if it compiles?
Code: Select all
#include <ft2build.h>
#include FT_FREETYPE_H
int main( int argc, char **argv )
{
FT_Library ft2Library;
FT_Face ft2Face;
// Comment this and voila... no compile-time error :-$
FT_Init_FreeType( &ft2Library );
// Source parameter is left NULL intentionally.
FT_New_Face( ft2Library, NULL, 0, &ft2Face );
return 0;
}
Code: Select all
EE_BIN = freetype.elf
EE_OBJS = main.o
EE_INCS += -I ./include -I $(PS2DEV)/.. -I $(PS2SDK)/ports/include
EE_LDFLAGS = -L $(PS2DEV)/.. -L $(PS2SDK)/ports/lib -L $(PS2SDK)/ee/lib
EE_CFLAGS += -fno-builtin-printf -Wall
EE_LIBS = -lfreetype -lkernel -lc -lgcc
all: $(EE_BIN)
clean:
@rm -f $(EE_BIN) $(EE_OBJS)
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1cid.o)(.text+0x12d4):src/cid/cidload.c:332: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1cid.o)(.text+0x12d8):src/cid/cidload.c:332: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1.o)(.text+0x7d8):src/type1/t1afm.c:115: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1.o)(.text+0x2c10):src/type1/t1afm.c:66: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1.o)(.text+0x7dc):src/type1/t1afm.c:115: undefined reference to `_ctype_'
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type1.o)(.text+0x828):src/type1/t1afm.c:124: more undefined references to `_ctype_' follow
/usr/local/ps2dev/ps2sdk/ports/lib/libfreetype.a(type42.o)(.text+0x2078):src/type42/t42drivr.c:96: undefined reference to `atoi'
collect2: ld returned 1 exit status
make: *** [freetype.elf] Error 1
Additional info:
OS: Debian GNU/Linux squeeze/sid
libfreetype is installed under:
/usr/local/ps2dev/ps2sdk/ports/include/freetype/
/usr/local/ps2dev/ps2sdk/ports/include/ft2build.h
/usr/local/ps2dev/ps2sdk/ports/libfreetype.a