Cant compile... [error]

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

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
harleyg
Posts: 123
Joined: Wed Oct 05, 2005 6:15 am

Cant compile... [error]

Post by harleyg »

i was looking over yeldarbs image tutorial, and i managed to get zlib and libpng running, but when i compile it, it says the following:

Code: Select all

make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o main.o main.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o graphics.o graphics.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o framebuffer.o framebuffer.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/pspdev/psp/sdk/lib   main.o graphics.o framebuffer.o -lpspgu -lz -lpng -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o hello.elf
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: skipping incompatible /usr/local/pspdev/psp/sdk/lib/libz.a when searching for -lz
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: skipping incompatible /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libz.a when searching for -lz
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: skipping incompatible /usr/local/pspdev/psp/bin/../lib/libz.a when searching for -lz
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: skipping incompatible /usr/local/pspdev/psp/lib/libz.a when searching for -lz
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [hello.elf] Error 1
any ideas?
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

psp-gcc ... -lpspgu -lz -lpng -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel ...
All those -lsomething options are the libraries you are trying to link. They are real files with lib in front of the name, like libm.a, libpspuser.a. You're missing libz. This is supposed to be zlib. So it looks like you didn't make or make install that properly. On cygwin these libs live here \usr\local\pspdev\psp\lib

Jim
User avatar
harleyg
Posts: 123
Joined: Wed Oct 05, 2005 6:15 am

Post by harleyg »

libz.a is in /usr/local/pspdev/psp/lib (i dont use cygwin...)
btw, with make && make install, it installs it to /usr/include, so i used prefix then put the files into the correct places myself...
:( still not working ):
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Sounds like you are building a native version and not the PSP specific one. Did you read README.PSP in the zlib directory by any chance?
User avatar
harleyg
Posts: 123
Joined: Wed Oct 05, 2005 6:15 am

Post by harleyg »

yes i did and all it says is make && make install, which is incorrect for a start as it installs to /usr/include...
User avatar
harleyg
Posts: 123
Joined: Wed Oct 05, 2005 6:15 am

Post by harleyg »

ok it seems zlib wasnt compiled for the psp...
but now i have a libpng problem, and this is compiled for the psp:

Code: Select all

make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o main.o main.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o graphics.o graphics.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o framebuffer.o framebuffer.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/pspdev/psp/sdk/lib   main.o graphics.o framebuffer.o -lpspgu -lz -lpng -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o hello.elf
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(png.o): In function `png_reset_crc':
png.c:(.text+0x1b0): undefined reference to `crc32'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../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'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(png.o): In function `png_reset_zstream':
png.c:(.text+0xb98): undefined reference to `inflateReset'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../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_'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In function `png_read_init_3':
pngread.c:(.text+0x4ac): undefined reference to `inflateInit_'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In function `png_read_row':
pngread.c:(.text+0xfbc): undefined reference to `inflate'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In function `png_read_destroy':
pngread.c:(.text+0x1d24): undefined reference to `inflateEnd'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../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'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngrutil.o): In function `png_read_finish_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'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwrite.o): In function `png_write_flush':
pngwrite.c:(.text+0x18d4): undefined reference to `deflate'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwrite.o): In function `png_write_destroy':
pngwrite.c:(.text+0x1998): undefined reference to `deflateEnd'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_text_compress':
pngwutil.c:(.text+0x298): undefined reference to `deflate'
pngwutil.c:(.text+0x37c): undefined reference to `deflate'
pngwutil.c:(.text+0x444): undefined reference to `deflate'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_write_compressed_data_out':
pngwutil.c:(.text+0x5d4): undefined reference to `deflateReset'
pngwutil.c:(.text+0x684): undefined reference to `deflateReset'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_write_IHDR':
pngwutil.c:(.text+0x8f8): undefined reference to `deflateInit2_'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_write_finish_row':
pngwutil.c:(.text+0x2cf4): undefined reference to `deflate'
pngwutil.c:(.text+0x2d30): undefined reference to `deflate'
pngwutil.c:(.text+0x2da0): undefined reference to `deflateReset'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_write_filtered_row':
pngwutil.c:(.text+0x3324): undefined reference to `deflate'
collect2: ld returned 1 exit status
make: *** [hello.elf] Error 1
Post Reply