PSPGL - Compiled lib ok, demos not so much[Solved]

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

Moderators: cheriff, TyRaNiD

Post Reply
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

PSPGL - Compiled lib ok, demos not so much[Solved]

Post by Kojima »

I succesfully downloaded and maked the library without any problems, but when making the demos I get the following error,

Code: Select all

C:\pspdev\pspgl\tests>make
mkdir .deps
convert firefox.png rgba:firefox.raw
Invalid Parameter - rgba:firefox.raw
make: *** [firefox.raw] Error 4
I removed the rule that invokes convert and then I was greeted with,

Code: Select all

C:\pspdev\pspgl\tests>make
make: *** No rule to make target `firefox.o', needed by `bezier.elf'.  Stop.
Which I assume is because convert never run, but I don't know really. Anyone else run into these problems? ( I can compile pspsdk demos fine )
Last edited by Kojima on Fri Jul 07, 2006 7:42 pm, edited 1 time in total.
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

Thanks, I'll have another stab at Cyngwin.
-edit- Do you know how to manually download the package you mentioned in that thread?
(Sorry for the dumb questions, but I've never used cyngwin before other than for about 20 mins a year or so back)

Does anyone know of a reason why cygwin would omit most of it's dev tools btw? I recall it taking an hour or so to install before, but now it takes under 10 mins and doesn't install vital tools like cc1.
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

Got it working by directly linking to the imageshack convert, but now there's a bunch of new errors,

Code: Select all

C:\pspdev\pspgl\tests>make
C:\convert firefox.png rgba:firefox.raw
(sym=`echo firefox | tr '-' '_'`; \
 echo -e ".data\n.global ${sym}_start\n${sym}_start:\n\t.incbin \"firefox.raw\""
 | psp-as -o firefox.o)
psp-gcc -std=gnu99 -fsingle-precision-constant -g -Wall -O2 -MD -MF .deps/bezier
.d -I.. -IC:/pspdev/psp/sdk/include -c bezier.c
psp-gcc -std=gnu99 -fsingle-precision-constant -g -Wall -O2 -MD -MF .deps/perfme
ter.d -I.. -IC:/pspdev/psp/sdk/include -c perfmeter.c
psp-gcc -std=gnu99 -fsingle-precision-constant -g -Wall -O2 -MD -MF .deps/screen
shot.d -I.. -IC:/pspdev/psp/sdk/include -c screenshot.c
screenshot.c(5) : column 17 :  error: png.h: No such file or directory
screenshot.c : In function 'writepng':
screenshot.c(13) : error: 'png_structp' undeclared (first use in this function)
screenshot.c(13) : error: (Each undeclared identifier is reported only once
screenshot.c(13) : error: for each function it appears in.)
screenshot.c(13) : error: syntax error before 'png_ptr'
screenshot.c(14) : error: 'png_infop' undeclared (first use in this function)
screenshot.c(17) : error: 'png_ptr' undeclared (first use in this function)
screenshot.c(17) : warning: implicit declaration of function 'png_create_write_s
truct'
screenshot.c(17) : error: 'PNG_LIBPNG_VER_STRING' undeclared (first use in this
function)
screenshot.c(20) : error: 'info_ptr' undeclared (first use in this function)
screenshot.c(20) : warning: implicit declaration of function 'png_create_info_st
ruct'
screenshot.c(24) : warning: implicit declaration of function 'png_init_io'
screenshot.c(25) : warning: implicit declaration of function 'png_set_IHDR'
screenshot.c(26) : error: 'PNG_COLOR_TYPE_RGB_ALPHA' undeclared (first use in th
is function)
screenshot.c(26) : error: 'PNG_INTERLACE_NONE' undeclared (first use in this fun
ction)
screenshot.c(27) : error: 'PNG_COMPRESSION_TYPE_DEFAULT' undeclared (first use i
n this function)
screenshot.c(27) : error: 'PNG_FILTER_TYPE_DEFAULT' undeclared (first use in thi
s function)
screenshot.c(32) : warning: implicit declaration of function 'png_set_rows'
screenshot.c(32) : error: 'png_byte' undeclared (first use in this function)
screenshot.c(32) : error: syntax error before ')' token
screenshot.c(33) : warning: implicit declaration of function 'png_write_png'
screenshot.c(33) : error: 'PNG_TRANSFORM_IDENTITY' undeclared (first use in this
 function)
screenshot.c(34) : warning: implicit declaration of function 'png_write_end'
screenshot.c(37) : warning: implicit declaration of function 'png_destroy_write_
struct'
screenshot.c(37) : error: 'png_infopp' undeclared (first use in this function)
make: *** [screenshot.o] Error 1
rm bezier.o firefox.raw perfmeter.o

considering it was only one file, I removed it and remaked, this time I get,

Code: Select all


C:\pspdev\pspgl\tests>make
make: *** No rule to make target `depthtest.elf', needed by `all'.  Stop.
Any ideas?
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

Got it compiled ago in the end.

For anyone else running into trouble with it, it's because you need zlib and libpng installed before hand.
I couldn't get libpng installed(Wouldn't compile out of the box, and I didn't feel like trying to fix it) so I just removed the screenshot code from the demos and voila, it all worked.
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

-Edited- Never mind, I just used the converted nehe tutorials as a base, they work perfectly.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Kojima wrote:-Edited- Never mind, I just used the converted nehe tutorials as a base, they work perfectly.
Yes, they are a great help!
zilt
Posts: 45
Joined: Tue Feb 21, 2006 11:59 pm
Location: Ontario, Canada
Contact:

Post by zilt »

Kojima wrote:I couldn't get libpng installed(Wouldn't compile out of the box, and I didn't feel like trying to fix it)
I guess you're not using the libpng and zlib from svn.ps2dev.org. They both work.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

zilt wrote:
Kojima wrote:I couldn't get libpng installed(Wouldn't compile out of the box, and I didn't feel like trying to fix it)
I guess you're not using the libpng and zlib from svn.ps2dev.org. They both work.
It is sometimes hard to know which library needs which other library, and in what order you need to install them. For instance libpng needs zlib installed first, and i think also another library.
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

I did grab them both from the svn, but libpng wouldn't compile.
zlib compiled fine first time.

In fact, libpng is the only lib I ever downloaded from ps2dev's svn that hasn't worked, so I guess it's just as arwin says a missing library, but I wasn't in the mood to figure out which one.
zilt
Posts: 45
Joined: Tue Feb 21, 2006 11:59 pm
Location: Ontario, Canada
Contact:

Post by zilt »

Kojima wrote: but I wasn't in the mood to figure out which one.
Did you bother to read the libpng README.PSP file? From the readme:
Requirements:

zlib
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

No I didn't.

Got another problem now, everything generally is working, but there's one function that can't be linked for some reason.

undefined reference to `gluOrtho2D'

I'm linking to lglu so I don't think it's that. Any ideas?
zilt
Posts: 45
Joined: Tue Feb 21, 2006 11:59 pm
Location: Ontario, Canada
Contact:

Post by zilt »

From looking at the pspgl source, gluOrtho2D doesn't appear to be implemented. Use glOrtho() instead. Here's my method for setting up 2D space for the gui:

Code: Select all

void pspRenderer::setup2D()
{
	GLCHK(glViewport( 0, 0, 480, 272 ));
	GLCHK(glMatrixMode( GL_PROJECTION ));
	GLCHK(glLoadIdentity());
	
	GLCHK(glOrtho(0.0, 480.0, 0.0, 272.0, -2.0, 2.0 ));
	GLCHK(glMatrixMode( GL_MODELVIEW ));
	GLCHK(glLoadIdentity());
}
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

Thanks Z, I'll give it a go. Glad it's possible, really want to lock down the 2d parts of my engine 'fore going 3d.
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

-edit- fixed it, was just a rouge function call that was screwing up the projection matrix.
Post Reply