SDL_ttf Compiling error

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

SDL_ttf Compiling error

Post by jojojoris »

I'm trying to compile a simple SDL_ttf_test program. but when i compile it i got an error.

Code: Select all

 undefined reference to `ceil'
the whole compiling output:

Code: Select all

psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -D_PSP_FW_VERSION=150  -L. -L/usr/local/pspdev/psp/sdk/lib   main.o -L/usr/local/pspdev/psp/lib -lSDLmain -lSDL -lm -lGL -lpspvfpu -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lpspirkeyb -lpsppower -lbulletml -lGLU -lm -lpspvram -lSDL_mixer -lstdc++ -lz -lbz2 -lglut -lmad -lSdkUtilities -lSDL_ttf -lsupc++ -lc -liberty -lmikmod -lSDL -lsmpeg -lvorbis -lfreetype -ljpeg -logg -lSDL_gfx -lsqlite3 -lvorbisenc -lg -llua -lpng -lSDL_image -lssp -lvorbisfile -lGL -llualib -lpspvalloc -lSDLmain -lssp_nonshared -lvorbisidec -lpspatrac3 -lpspge -lpspnet -lpspsdk -lpspaudio -lpspge_driver -lpspnet_adhoc -lpspsircs -lpspaudiocodec -lpspgu -lpspnet_adhocctl -lpspumd -lpspaudio_driver -lpspgum -lpspnet_adhocmatching -lpspumd_driver -lpspaudiolib -lpspgum_vfpu -lpspnet_apctl -lpspusb -lpspchnnlsv -lpsphprm -lpspnet_inet -lpspusbbus_driver -lpspctrl -lpsphprm_driver -lpspnet_resolver -lpspusbcam -lpspctrl_driver -lpsphttp -lpspopenpsid -lpspusb_driver -lpspdebug -lpspirkeyb -lpsppaf -lpspusbstor -lpspdebugkb -lpspjpeg -lpsppower -lpspuser -lpspdisplay -lpspkernel -lpsppower_driver -lpsputility -lpspdisplay_driver -lpsplibc -lpspprof -lpspvfpu -lpspfpu -lpspmpeg -lpspreg -lpspvideocodec -lpspgdb -lpspmpegbase -lpspreg_driver -lpspvshbridge -lpspgdb_kernel -lpspmpegbase_driver -lpsprtc -lpspwlan -lpspgdb_user -lpspnand_driver -lpsprtc_driver  -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o SDLttf.elf
/usr/local/pspdev/psp/lib/libSDL_ttf.a(SDL_ttf.o): In function `Find_Glyph':
/home/joris/pspsdk/trunk/psplibraries/build/SDL_ttf/SDL_ttf.c:475: undefined reference to `ceil'
/home/joris/pspsdk/trunk/psplibraries/build/SDL_ttf/SDL_ttf.c:535: undefined reference to `ceil'
collect2: ld gaf exit-status 1 terug
make: *** [SDLttf.elf] Fout 1
As you can see i included all the libraries i found but i still got the error.

How can i solve this?
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

You need to add -lm to your LIBS line after -lSDL_ttf, not before. Order is important.
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

ok
tanks
It works :)
Post Reply