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 

building libpng

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



Joined: 24 Feb 2008
Posts: 51

PostPosted: Sun Feb 24, 2008 3:44 am    Post subject: building libpng Reply with quote

I built libpng and libz using devkitPSP. They build fine.

I then tried to link them into my elf. I am getting link errors about fprintf (usually in stdio), pow (usually in math), longjmp (not sure about this one), and strtod (string).

My link command looks like this:
Code:

psp-gcc -o build/debug/game.elf -specs=c:/devkitPSP/psp/sdk/lib/prxspecs -Wl,-q,-Tc:/devkitPSP/psp/sdk/lib/linkfile.prx c:/devkitPSP/psp/sdk/lib/prxexports.o build/debug/GameApp.o build/debug/GraphicsObject.o build/debug/main.o build/debug/Pad.o build/debug/graphics.o -Lc:/devkitPSP/psp/sdk/lib -Llibs/libpng -Llibs/zlib  -lstdc++ -lc -lpspgu -lpsprtc -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -lpng -lz


And My output is this:
Code:

libs/libpng\libpng.a(pngerror.o): In function `png_warning':
pngerror.c:(.text+0x1a0): undefined reference to `fprintf'
pngerror.c:(.text+0x218): undefined reference to `fprintf'
libs/libpng\libpng.a(pngerror.o): In function `png_error':
pngerror.c:(.text+0x304): undefined reference to `fprintf'
pngerror.c:(.text+0x310): undefined reference to `longjmp'
pngerror.c:(.text+0x37c): undefined reference to `fprintf'
pngerror.c:(.text+0x398): undefined reference to `fprintf'
libs/libpng\libpng.a(pngread.o): In function `png_create_read_struct_2':
pngread.c:(.text+0x1f20): undefined reference to `setjmp'
pngread.c:(.text+0x2054): undefined reference to `setjmp'
libs/libpng\libpng.a(pngrio.o): In function `png_default_read_data':
pngrio.c:(.text+0x8c): undefined reference to `fread'
libs/libpng\libpng.a(pngrtran.o): In function `png_build_gamma_table':
pngrtran.c:(.text+0x2c18): undefined reference to `pow'
pngrtran.c:(.text+0x2d08): undefined reference to `pow'
pngrtran.c:(.text+0x2e70): undefined reference to `pow'
pngrtran.c:(.text+0x2fd4): undefined reference to `pow'
pngrtran.c:(.text+0x30b0): undefined reference to `pow'
libs/libpng\libpng.a(pngrtran.o):pngrtran.c:(.text+0x319c): more undefined references to `pow' follow
libs/libpng\libpng.a(pngrutil.o): In function `png_handle_sCAL':
pngrutil.c:(.text+0x2254): undefined reference to `strtod'
pngrutil.c:(.text+0x2298): undefined reference to `strtod'
libs/libpng\libpng.a(pngrutil.o): In function `png_handle_sRGB':
pngrutil.c:(.text+0x38c8): undefined reference to `fprintf'
libs/libpng\libpng.a(pngrutil.o): In function `png_handle_cHRM':
pngrutil.c:(.text+0x3e90): undefined reference to `fprintf'
pngrutil.c:(.text+0x3f00): undefined reference to `fprintf'
libs/libpng\libpng.a(pngrutil.o): In function `png_handle_gAMA':
pngrutil.c:(.text+0x430c): undefined reference to `fprintf'
libs/libpng\libpng.a(pngwrite.o): In function `png_create_write_struct_2':
pngwrite.c:(.text+0x1354): undefined reference to `setjmp'
pngwrite.c:(.text+0x1424): undefined reference to `setjmp'
libs/libpng\libpng.a(pngwrite.o): In function `png_convert_from_time_t':
pngwrite.c:(.text+0x1574): undefined reference to `gmtime'
libs/libpng\libpng.a(pngwutil.o): In function `png_write_cHRM_fixed':
pngwutil.c:(.text+0x2054): undefined reference to `fprintf'
libs/libpng\libpng.a(pngwutil.o): In function `png_write_cHRM':
pngwutil.c:(.text+0x2294): undefined reference to `fprintf'
collect2: ld returned 1 exit status


I didn't think there was a fprintf? I thouth you had to use pspDebugPrintf()?

Thanks,
~S[/code]
Back to top
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Sun Feb 24, 2008 4:07 am    Post subject: Reply with quote

Could you post your makefile?

Maybe your problem is just the linking order.
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sun Feb 24, 2008 4:26 am    Post subject: Reply with quote

Looks like an order problem.

Code:
-lpng -lz -lm -lstdc++


Those should be the last items in your LIBS line.
Back to top
View user's profile Send private message
snowsquirrel



Joined: 24 Feb 2008
Posts: 51

PostPosted: Sun Feb 24, 2008 7:11 am    Post subject: Reply with quote

I am away from my dev computer right now, but I know I don't have libm listed, so I must be missing that. I already solved the stdio stuff, with order. , this should get the math stuff. Thanks witty.

Thanks for the help, I can tell this forum will be helpful.

BTW - I don't suppose libgmo has been ported over? It seems so much of the official stuff has 1:1 mappings, yet I can't find anything like gmo?

Thanks,

~Snow

ps - I don't use Makefiles. I use Rakefiles, as I am a ruby guy.
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