PRX Lib Link Error

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

Moderators: cheriff, TyRaNiD

Post Reply
71M
Posts: 122
Joined: Tue Jun 21, 2005 5:28 am
Location: London

PRX Lib Link Error

Post by 71M »

Hi,
I'm trying to link the png lib into a PRX, but I'm getting the following error.

Code: Select all

psp-gcc -I../../../ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/pspdev/psp/sdk/lib -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx -mno-crt0 -nostartfiles   Main.o -lpng -lz -lc -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lpsplibc -lpspuser -lpspkernel -o PNG.elf
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libc.a(pspcwd.o): In function `__psp_init_cwd':
../../../../../../newlib/libc/sys/psp/pspcwd.c:28: undefined reference to `__psp_argv_0'
../../../../../../newlib/libc/sys/psp/pspcwd.c:28: undefined reference to `__psp_argv_0'
collect2: ld returned 1 exit status
make: *** [PNG.elf] Error 1
I couldn't find anything on the forums, so no doubt this'll be something foolish that I'm doing on my side :)

Cheers,
71M
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

__psp_argv_0 is defined in crt0.o, so you need to get rid of -mno-crt0 and -nostartfiles or specify the full path to crt0.o on the linker command line.
71M
Posts: 122
Joined: Tue Jun 21, 2005 5:28 am
Location: London

Post by 71M »

Brilliant that seems to have sorted it, thank you.

71M
Post Reply