forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SDL_image

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Orion_



Joined: 27 Jan 2005
Posts: 69

PostPosted: Thu Oct 27, 2005 12:49 am    Post subject: SDL_image Reply with quote

after hours I finally succeed in compiling SDL then zlib, libpng, jpeg and SDL_image, under devkitPSP
I tried the SDL example in "tests" folder from svn, then changed a bit to use SDL_image and I get a lots of error from SDL_image lib :/

$ make
psp-gcc -I. -I/c/devkitPro/devkitpsp/psp/sdk/include -O2 -G0 -Wall `/c/devkitPro /devkitpsp/psp/sdk/../bin/sdl-config --cflags` -L. -L/c/devkitPro/devkitpsp/psp /sdk/lib sdltest.o `/c/devkitPro/devkitpsp/psp/sdk/../bin/sdl-config --libs` - lSDL_image -ljpeg -lz -lpng -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk - lc -lpspuser -lpspkernel -o sdltest.elf
c:/devkitPro/devkitPSP/psp/lib\libSDL_image.a(IMG.o): In function `IMG_Load':
c:\devkitPro\devkitPSP\SDL_image/IMG.c:65: undefined reference to `SDL_RWFromFil e'
c:/devkitPro/devkitPSP/psp/lib\libSDL_image.a(IMG_bmp.o): In function `IMG_LoadB MP_RW':
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:196: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:197: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:198: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:199: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:202: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:215: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:216: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:217: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:218: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:219: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:220: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:221: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:222: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:223: undefined reference to `SDL_Read LE32'
c:/devkitPro/devkitPSP/psp/lib\libSDL_image.a(IMG_bmp.o):c:\devkitPro\devkitPSP\ SDL_image/IMG_bmp.c:224: more undefined references to `SDL_ReadLE32' follow
c:/devkitPro/devkitPSP/psp/lib\libSDL_image.a(IMG_bmp.o): In function `IMG_LoadB MP_RW':
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:204: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:205: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:206: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:207: undefined reference to `SDL_Read LE16'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(png.o): In function `png_reset_crc':
png.c:(.text+0x1b0): undefined reference to `crc32'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(png.o): In function `png_calculate_crc':
png.c:(.text+0x1fc): undefined reference to `crc32'
png.c:(.text+0x228): undefined reference to `crc32'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(png.o): In function `png_reset_zstream':
png.c:(.text+0xb9c): undefined reference to `inflateReset'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngread.o): In function `png_create_read _struct_2':
pngread.c:(.text+0x134): undefined reference to `inflateInit_'
pngread.c:(.text+0x27c): undefined reference to `inflateInit_'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngread.o): In function `png_read_init_3 ':
pngread.c:(.text+0x4ac): undefined reference to `inflateInit_'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngread.o): In function `png_read_row':
pngread.c:(.text+0xfbc): undefined reference to `inflate'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngread.o): In function `png_read_destro y':
pngread.c:(.text+0x1d24): undefined reference to `inflateEnd'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngrtran.o): In function `png_build_gamm a_table':
pngrtran.c:(.text+0x1240): undefined reference to `pow'
pngrtran.c:(.text+0x1458): undefined reference to `pow'
pngrtran.c:(.text+0x1500): undefined reference to `pow'
pngrtran.c:(.text+0x1618): undefined reference to `pow'
pngrtran.c:(.text+0x16f4): undefined reference to `pow'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngrtran.o):pngrtran.c:(.text+0x17e0): m ore undefined references to `pow' follow
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngrutil.o): In function `png_decompress _chunk':
pngrutil.c:(.text+0x334): undefined reference to `inflate'
pngrutil.c:(.text+0x43c): undefined reference to `inflateReset'
pngrutil.c:(.text+0x584): undefined reference to `inflateReset'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngrutil.o): In function `png_read_finis h_row':
pngrutil.c:(.text+0x43d4): undefined reference to `inflate'
pngrutil.c:(.text+0x445c): undefined reference to `inflateReset'
pngrutil.c:(.text+0x44a4): undefined reference to `inflateReset'
make: *** [sdltest.elf] Error 1


why ? since all the lib before compiled just fine :/
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Thu Oct 27, 2005 1:34 am    Post subject: Reply with quote

Bug WinterMute for support on devkitPro. I'm not trying to be harsh, but we don't know what he's done to the toolchain setup and install. We can only support the toolchain.sh that we've created.
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Thu Oct 27, 2005 5:53 am    Post subject: Reply with quote

Your link order is wrong. -lSDL_image needs to go before `sdl-config --libs` because it depends on the SDL libraries. -lpng has to be before -lz, and you're missing -lm.

Welcome to the wonderful world of GNU linking!
Back to top
View user's profile Send private message
sherpya



Joined: 03 Oct 2005
Posts: 61

PostPosted: Thu Oct 27, 2005 8:24 am    Post subject: Reply with quote

I've also noticed this nightmare playing with the order of linked libraries, but I never seen this behaviour e.g. on linux, I've seen similar problems in the solaris linker, there is no way to avoid it? psp linked libs are likely to easly increase in number and this problem can be very annoying
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Oct 27, 2005 9:20 am    Post subject: Reply with quote

It's the same linker that Linux uses, but you generally don't see this problem when linking against shared libraries. When doing static linking as on the PSP, the linker goes in order and only includes objects found in each library if it needs them to solve an earlier dependency. You can repeat libraries or use --start-group and --end-group to satisfy cyclic dependencies or if you don't want to figure out the proper order.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group